Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I would like to add some tests to verify the behaviour of the phar file as part of #511. However, given that the phar file seems to be currently untested, I'm adding a basic set of tests here as there are multiple approaches for this, and I don't want to pollute #511 with that discussion.
In this pull request, I'm usingphing
to build the phar in asetUpBeforeClass()
method, but because that library messes with the composer installation, I'm wrapping that withcomposer install
.Another approach would be to use phing to build the phar in a GitHub Action workflow (eg, based on.github/workflows/phar-creation.yml
), and then run some stand-alone tests written in a shell script or similar. This approach would remove the complication of having to compile a phar / use phing from within phpunit, but would mean we'd have to maintain two different testing frameworks.In this pull request, I've chosen to skip the tests for the phar file if it's not found on disk, and to build the phar as part of the GitHub Actions workflow, just before we run the phpunit test suite.