summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2023-06-06 08:58:26 +0200
committerRemi Collet <remi@php.net>2023-06-06 08:58:26 +0200
commit8c213e6bb50d1c4055c378af4fa1d23ff661983f (patch)
tree06b3aa78d535857d9704eed34a2f2977015f0749
parentbc072a7a07a32d8eac956a96e29c0080e281a660 (diff)
update to 1.6.1
-rw-r--r--composer.json57
-rw-r--r--mockery-tests.patch18
-rw-r--r--php-mockery.spec52
3 files changed, 67 insertions, 60 deletions
diff --git a/composer.json b/composer.json
index 43caba8..d1382d5 100644
--- a/composer.json
+++ b/composer.json
@@ -1,9 +1,7 @@
{
"name": "mockery/mockery",
"description": "Mockery is a simple yet flexible PHP mock object framework",
- "scripts": {
- "docs": "phpdoc -d library -t docs/api"
- },
+ "license": "BSD-3-Clause",
"keywords": [
"bdd",
"library",
@@ -16,8 +14,6 @@
"test double",
"testing"
],
- "homepage": "https://github.com/mockery/mockery",
- "license": "BSD-3-Clause",
"authors": [
{
"name": "Pádraic Brady",
@@ -30,26 +26,36 @@
"homepage": "http://davedevelopment.co.uk"
}
],
+ "homepage": "https://github.com/mockery/mockery",
"require": {
- "php": "^7.3 || ^8.0",
+ "php": "^7.4 || ^8.0",
"lib-pcre": ">=7.0",
"hamcrest/hamcrest-php": "^2.0.1"
},
"require-dev": {
- "phpunit/phpunit": "^8.5 || ^9.3"
+ "phpunit/phpunit": "^8.5 || ^9.3",
+ "psalm/plugin-phpunit": "^0.18",
+ "vimeo/psalm": "^5.9"
},
"conflict": {
"phpunit/phpunit": "<8.0"
},
"autoload": {
- "psr-0": {
- "Mockery": "library/"
- }
+ "psr-4": {
+ "Mockery\\": "library/Mockery"
+ },
+ "files": [
+ "library/helpers.php",
+ "library/Mockery.php"
+ ]
},
"autoload-dev": {
"psr-4": {
"test\\": "tests/"
- }
+ },
+ "files": [
+ "vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php"
+ ]
},
"config": {
"preferred-install": "dist"
@@ -58,5 +64,34 @@
"branch-alias": {
"dev-master": "1.4.x-dev"
}
+ },
+ "scripts": {
+ "check": [
+ "@composer validate",
+ "@test",
+ "@psalm:security",
+ "@psalm:dry-run"
+ ],
+ "docs": "phpdoc -d library -t docs/api",
+ "phpunit": [
+ "@xdebug",
+ "vendor/bin/phpunit --colors=always --testdox --stop-on-failure"
+ ],
+ "psalm": [
+ "@xdebug",
+ "@psalm:shepherd"
+ ],
+ "psalm:baseline": "vendor/bin/psalm --set-baseline=psalm-baseline.xml",
+ "psalm:dry-run": "vendor/bin/psalm --alter --issues=all --dry-run",
+ "psalm:missing": "vendor/bin/psalm --alter --issues=MissingReturnType",
+ "psalm:security": "vendor/bin/psalm --taint-analysis",
+ "psalm:shepherd": "vendor/bin/psalm --shepherd --show-info=false --stats --no-diff --no-cache",
+ "test": [
+ "@phpunit",
+ "@psalm"
+ ],
+ "xdebug": [
+ "@putenv XDEBUG_MODE=coverage"
+ ]
}
}
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 bdf40a3..9e55aa8 100644
--- a/php-mockery.spec
+++ b/php-mockery.spec
@@ -9,7 +9,7 @@
#
%bcond_without tests
-%global gh_commit e92dcc83d5a51851baf5f5591d32cb2b16e3684e
+%global gh_commit a8dd186f07ea667c1e3abd2176bfab0ab161ea94
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_owner mockery
%global gh_project mockery
@@ -17,11 +17,11 @@
%global major 1
Name: php-mockery
-Version: 1.5.1
+Version: 1.6.1
Release: 1%{?dist}
Summary: Mockery is a simple but flexible PHP mock object framework
-License: BSD
+License: BSD-3-Clause
URL: https://github.com/%{gh_owner}/%{gh_project}
Source0: %{name}-%{version}-%{gh_short}.tgz
Source1: makesrc.sh
@@ -31,15 +31,13 @@ Patch0: %{gh_project}-tests.patch
BuildArch: noarch
%if %{with tests}
-BuildRequires: php(language) >= 7.3
+BuildRequires: php(language) >= 7.4
# From composer.json, "require-dev": {
-# "phpunit/phpunit": "^8.5|^9.3"
-%if 0%{?fedora} >= 31 || 0%{?rhel} >= 9
+# "phpunit/phpunit": "^8.5|^9.3",
+# "psalm/plugin-phpunit": "^0.18",
+# "vimeo/psalm": "^5.9"
%global phpunit %{_bindir}/phpunit9
BuildRequires: phpunit9 >= 9.3
-%endif
-%global phpunit %{_bindir}/phpunit8
-BuildRequires: phpunit8 >= 8.5
# 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)
@@ -47,12 +45,13 @@ BuildRequires: (php-composer(hamcrest/hamcrest-php) >= 2.0.1 with php-composer(h
%else
BuildRequires: php-hamcrest2 >= 2.0.1
%endif
+BuildRequires: php-pdo
# Autoloader
%endif
BuildRequires: php-fedora-autoloader-devel
# From composer.json, "require": {
-# "php": "^7.3 || ^8.0",
+# "php": "^7.4 || ^8.0",
# "lib-pcre": ">=7.0",
# "hamcrest/hamcrest-php": "~2.0"
Requires: php(language) >= 7.3
@@ -91,10 +90,11 @@ cat << 'EOF' | tee -a library/%{ns_project}/autoload.php
\Fedora\Autoloader\Dependencies::required([
'/usr/share/php/Hamcrest2/autoload.php',
+ __DIR__ . '/helpers.php',
]);
EOF
-%patch0 -p0 -b .rpm
+%patch -P0 -p0 -b .rpm
rm -f docs/.gitignore
@@ -118,27 +118,14 @@ phpab --output tests/classmap.php --exclude */SemiReservedWordsAsMethods.php tes
: Run upstream test suite
ret=0
-for cmd in php php74 php80 php81 php82; do
+# need investigation
+rm tests/Mockery/MockeryCanMockClassesWithSemiReservedWordsTest.php
+
+for cmd in php php80 php81 php82; do
if which $cmd; then
- 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
+ $cmd %{_bindir}/phpunit9 \
+ --no-coverage \
+ --verbose || ret=1
fi
done
exit $ret
@@ -155,6 +142,9 @@ exit $ret
%changelog
+* Tue Jun 6 2023 Remi Collet <remi@remirepo.net> - 1.6.1-1
+- update to 1.6.1
+
* Mon Sep 12 2022 Remi Collet <remi@remirepo.net> - 1.5.1-1
- update to 1.5.1