Switch to prophecy-phpunit trait#337
Conversation
|
Oh sorry, didn't check for lower deps. Maybe it's time to let php < 7.3 go? |
|
we recently got reports from users using this package for lower PHP when we accidentally broke it, I wouldn't go that path. |
|
Why? Raising minimum version isn't a breaking change, users with php < 7.3 can still use the old version. |
|
FYI: there is a PR open in |
|
I believe we can drop <7.2 by now |
I have no objection to this change. While this will make things slightly more difficult for projects which do code coverage runs on their high-low supported PHP versions if their "low" PHP version is below PHP 7.2, it can still work perfectly well as the PHP version on which the tests are run does not have to be the same PHP version on which code coverage is uploaded. To do so, one would have to switch the PHP version within the CI job. With GH Actions and the I'm already doing this for a project which still supports PHP 5.4 (while the 2.x version of this package has a PHP 5.5 minimum). Example code: jobs:
coverage:
# ... All the normal config and steps to set up the environment and run the tests ...
- name: Run the unit tests with code coverage
run: vendor/bin/phpunit
# Uploading the results with PHP Coveralls v2.x needs PHP 5.5+, so switch the PHP version.
- name: Switch to PHP 7.4
if: ${{ success() && matrix.php != '7.4' }}
uses: shivammathur/setup-php@v2
with:
php-version: 7.4
coverage: none
- name: Install Coveralls
if: ${{ success() }}
run: composer require php-coveralls/php-coveralls:"^2.5.3"
- name: Upload coverage results to Coveralls
if: ${{ success() }}
env:
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: php-${{ matrix.php }}-phpcs-${{ matrix.phpcs_version }}
run: vendor/bin/php-coveralls -v -x build/logs/clover.xmlMight be good to make people aware of this option to switch PHP versions within a job by documenting it in the README. |
also, one could upload the coverage with php-coveralls v2.5.3. they will not receive any new versions of php-coveralls, but also not that much is changing in this project and they don't need to run cutting-edge version of php-coveralls, and running legacy PHP version could be bigger problem to start with ;) |
|
replaced by #386 |
Since prophecy-support in phpunit is deprecated, and will be remove in phpunit 10, this PR add prophecy-support via phpspec/prophecy-phpunit.