summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json9
-rwxr-xr-xmakesrc.sh28
-rw-r--r--mockery-tests.patch18
-rw-r--r--php-mockery.spec52
4 files changed, 64 insertions, 43 deletions
diff --git a/composer.json b/composer.json
index 44ffe51..43caba8 100644
--- a/composer.json
+++ b/composer.json
@@ -31,12 +31,15 @@
}
],
"require": {
- "php": ">=5.6.0",
+ "php": "^7.3 || ^8.0",
"lib-pcre": ">=7.0",
"hamcrest/hamcrest-php": "^2.0.1"
},
"require-dev": {
- "phpunit/phpunit": "^5.7.10|^6.5|^7.5|^8.5|^9.3"
+ "phpunit/phpunit": "^8.5 || ^9.3"
+ },
+ "conflict": {
+ "phpunit/phpunit": "<8.0"
},
"autoload": {
"psr-0": {
@@ -53,7 +56,7 @@
},
"extra": {
"branch-alias": {
- "dev-master": "1.3.x-dev"
+ "dev-master": "1.4.x-dev"
}
}
}
diff --git a/makesrc.sh b/makesrc.sh
new file mode 100755
index 0000000..87a1c0b
--- /dev/null
+++ b/makesrc.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+NAME=$(basename $PWD)
+OWNER=$(sed -n '/^%global gh_owner/{s/.* //;p}' $NAME.spec)
+PROJECT=$(sed -n '/^%global gh_project/{s/.* //;p}' $NAME.spec)
+VERSION=$(sed -n '/^Version:/{s/.* //;p}' $NAME.spec)
+COMMIT=$(sed -n '/^%global gh_commit/{s/.* //;p}' $NAME.spec)
+SHORT=${COMMIT:0:7}
+
+echo -e "\nCreate git snapshot\nName=$NAME, Owner=$OWNER, Project=$PROJECT, Version=$VERSION, Commit=$COMMIT\n"
+
+echo "Cloning..."
+git clone --recursive https://github.com/$OWNER/$PROJECT.git $PROJECT-$COMMIT
+
+echo "Getting commit..."
+pushd $PROJECT-$COMMIT
+git checkout $COMMIT
+cp composer.json ../composer.json
+popd
+
+echo "Archiving..."
+tar czf $NAME-$VERSION-$SHORT.tgz --exclude-vcs $PROJECT-$COMMIT
+
+echo "Cleaning..."
+rm -rf $PROJECT-$COMMIT
+
+echo "Done."
+
diff --git a/mockery-tests.patch b/mockery-tests.patch
deleted file mode 100644
index 3019204..0000000
--- a/mockery-tests.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-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 0579ca0..f7dc646 100644
--- a/php-mockery.spec
+++ b/php-mockery.spec
@@ -7,16 +7,17 @@
#
# Please preserve changelog entries
#
-%global gh_commit 60fa2f67f6e4d3634bb4a45ff3171fa52215800d
+%bcond_without tests
+
+%global gh_commit 20cab678faed06fac225193be281ea0fddb43b93
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner mockery
%global gh_project mockery
%global ns_project Mockery
%global major 1
-%global with_tests 0%{!?_without_tests:1}
Name: php-mockery
-Version: 1.3.3
+Version: 1.4.2
Release: 1%{?dist}
Summary: Mockery is a simple but flexible PHP mock object framework
@@ -29,38 +30,40 @@ Source1: makesrc.sh
Patch0: %{gh_project}-tests.patch
BuildArch: noarch
-%if %{with_tests}
-BuildRequires: php(language) >= 5.6.0
+%if %{with tests}
+BuildRequires: php(language) >= 7.3
# From composer.json, "require-dev": {
-# "phpunit/phpunit": "^5.7.10|^6.5|^7.5|^8.5|^9.3"
-# remirepo:1
-%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+# "phpunit/phpunit": "^8.5|^9.3"
+%if 0%{?fedora} >= 31 || 0%{?rhel} >= 9
%global phpunit %{_bindir}/phpunit9
BuildRequires: phpunit9 >= 9.3
-BuildRequires: (php-composer(hamcrest/hamcrest-php) >= 2.0.1 with php-composer(hamcrest/hamcrest-php) < 3)
-# remirepo:5
-%else
+%endif
%global phpunit %{_bindir}/phpunit8
BuildRequires: phpunit8 >= 8.5
-BuildRequires: php-hamcrest2 >= 2.0.1
+# remirepo:1
+%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
+BuildRequires: (php-composer(hamcrest/hamcrest-php) >= 2.0.1 with php-composer(hamcrest/hamcrest-php) < 3)
+# remirepo:3
+%else
+BuildRequires: php-hamcrest2 >= 2.0.1
%endif
# Autoloader
%endif
BuildRequires: php-fedora-autoloader-devel
# From composer.json, "require": {
-# "php": ">=5.6.0",
+# "php": "^7.3 || ^8.0",
# "lib-pcre": ">=7.0",
# "hamcrest/hamcrest-php": "~2.0"
-Requires: php(language) >= 5.6.0
+Requires: php(language) >= 7.3
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-Requires: (php-composer(hamcrest/hamcrest-php) >= 2.0.1 with php-composer(hamcrest/hamcrest-php) < 3)
+Requires: (php-composer(hamcrest/hamcrest-php) >= 2.0.1 with php-composer(hamcrest/hamcrest-php) < 3)
# remirepo:3
%else
-Requires: php-hamcrest2 >= 2.0.1
+Requires: php-hamcrest2 >= 2.0.1
%endif
-# From phpcompatinfo report for version 1.0
+# From phpcompatinfo report for version 1.4.2
Requires: php-pcre
Requires: php-spl
Requires: php-reflection
@@ -106,7 +109,7 @@ cp -rp library/%{ns_project} %{buildroot}/%{_datadir}/php/%{ns_project}%{major}
%check
-%if %{with_tests}
+%if %{with tests}
: Use installed tree and our autoloader
export COMPOSER_VENDOR_DIR=%{buildroot}%{_datadir}/php/%{ns_project}%{major}
@@ -114,13 +117,13 @@ phpab --output tests/classmap.php --exclude */SemiReservedWordsAsMethods.php tes
: Run upstream test suite
ret=0
-for cmd in "php %{phpunit}" "php72 %{_bindir}/phpunit8" php73 php74 php80; do
+for cmd in "php %{phpunit}" php73 php74 php80; do
if which $cmd; then
set $cmd
# see .travis.yml
- if [ $($1 -r 'echo PHP_MAJOR_VERSION;') -lt 7 ]
- then SUITE="Mockery Test Suite PHP56"
- else SUITE="Mockery Test Suite"
+ if [ $($1 -r 'echo PHP_MAJOR_VERSION;') -lt 8 ]
+ then SUITE="Mockery Test Suite PHP7"
+ else SUITE="Mockery Test Suite PHP8"
fi
$1 ${2:-%{_bindir}/phpunit9} \
--no-coverage \
@@ -141,6 +144,11 @@ exit $ret
%changelog
+* Mon Oct 12 2020 Remi Collet <remi@remirepo.net> - 1.4.2-1
+- update to 1.4.2
+- raise dependency on PHP 7.3
+- drop compatibility with old phpunit 5, 6 and 7
+
* Mon Aug 17 2020 Remi Collet <remi@remirepo.net> - 1.3.3-1
- update to 1.3.3