-
Notifications
You must be signed in to change notification settings - Fork 13
Add tests and GitHub actions #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
They can be launched from the base dir with: php tests/png.php
Any news ? |
@@ -27,7 +27,7 @@ | |||
* @link http://pear.php.net/package/Image_Canvas | |||
*/ | |||
|
|||
require_once 'Image/Canvas.php'; | |||
require_once 'vendor/autoload.php'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Won't let this stop a merge now, but I'd prefer a more flexible approach here that doesn't force a composer installation before someone could run the testsuite. Just a simple existence check on the vendor autoload in order to require it, and fall back to the old PEAR-style require otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good remark but I'm not sure I understand all the details of it. Just testing the existence of vendor/autoload.php
would be enough ? Do you know a package that does that (so I can take inspiration from it) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (file_exists('vendor/autoload.php')) {
// use composer if available
require_once 'vendor/autoload.php';
} else {
// otherwise rely on classic PEAR include_path
require_once 'Image/Canvas.php';
}
Thanks @ashnazg for merging this. |
This PR modifies the test scripts so they can be run on modern installation. Also it set up github actions.
Technical details
PDFlib
extension so there is 0 chances this works (it should be redone in another PR).