diff options
author | Remi Collet <remi@remirepo.net> | 2020-10-29 14:52:15 +0100 |
---|---|---|
committer | Remi Collet <remi@remirepo.net> | 2020-10-29 14:52:15 +0100 |
commit | 22f08fe592d14afb364baf0cb0f22ce9d1e17390 (patch) | |
tree | dc5b195ae329f5f6af51c2d73b8d23cb99401596 | |
parent | ef4b4cf7b1d26a6836c56e02185247d167af0b9b (diff) |
run test suite with both phpunit 8 and 9
-rw-r--r-- | mockery-tests.patch | 18 | ||||
-rw-r--r-- | php-mockery.spec | 30 |
2 files changed, 39 insertions, 9 deletions
diff --git a/mockery-tests.patch b/mockery-tests.patch new file mode 100644 index 0000000..3019204 --- /dev/null +++ b/mockery-tests.patch @@ -0,0 +1,18 @@ +diff -up ./tests/Bootstrap.php.rpm ./tests/Bootstrap.php +--- ./tests/Bootstrap.php.rpm 2018-05-08 10:54:48.000000000 +0200 ++++ ./tests/Bootstrap.php 2018-05-13 10:39:38.471383840 +0200 +@@ -50,11 +50,9 @@ if (!file_exists($autoloadPath)) { + + require_once $autoloadPath; + +-$hamcrestRelativePath = 'hamcrest/hamcrest-php/hamcrest/Hamcrest.php'; +-if (DIRECTORY_SEPARATOR !== '/') { +- $hamcrestRelativePath = str_replace('/', DIRECTORY_SEPARATOR, $hamcrestRelativePath); +-} +-$hamcrestPath = $composerVendorDirectory . DIRECTORY_SEPARATOR . $hamcrestRelativePath; ++require_once __DIR__ . '/classmap.php'; ++ ++$hamcrestPath = '/usr/share/php/Hamcrest2/Hamcrest.php'; + + require_once $hamcrestPath; + diff --git a/php-mockery.spec b/php-mockery.spec index f7dc646..6df64bd 100644 --- a/php-mockery.spec +++ b/php-mockery.spec @@ -117,17 +117,28 @@ phpab --output tests/classmap.php --exclude */SemiReservedWordsAsMethods.php tes : Run upstream test suite ret=0 -for cmd in "php %{phpunit}" php73 php74 php80; do + +for cmd in php php73 php74 php80; do if which $cmd; then - set $cmd - # see .travis.yml - if [ $($1 -r 'echo PHP_MAJOR_VERSION;') -lt 8 ] - then SUITE="Mockery Test Suite PHP7" - else SUITE="Mockery Test Suite PHP8" + if [ $($cmd -r 'echo PHP_MAJOR_VERSION;') -lt 8 ] + then + # see .travis.yml + SUITE="Mockery Test Suite PHP7" + + if [ -x %{_bindir}/phpunit8 ] ; then + $cmd %{_bindir}/phpunit8 \ + --no-coverage \ + --verbose --testsuite="$SUITE" || ret=1 + fi + else + SUITE="Mockery Test Suite PHP8" + fi + + if [ -x %{_bindir}/phpunit9 ] ; then + $cmd %{_bindir}/phpunit9 \ + --no-coverage \ + --verbose --testsuite="$SUITE" || ret=1 fi - $1 ${2:-%{_bindir}/phpunit9} \ - --no-coverage \ - --verbose --testsuite="$SUITE" || ret=1 fi done exit $ret @@ -148,6 +159,7 @@ exit $ret - update to 1.4.2 - raise dependency on PHP 7.3 - drop compatibility with old phpunit 5, 6 and 7 +- run test suite with both phpunit 8 and 9 * Mon Aug 17 2020 Remi Collet <remi@remirepo.net> - 1.3.3-1 - update to 1.3.3 |