summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mockery-tests.patch18
-rw-r--r--php-mockery.spec30
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