summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--composer.json97
-rwxr-xr-xmakesrc.sh28
-rw-r--r--php-mockery.spec142
3 files changed, 216 insertions, 51 deletions
diff --git a/composer.json b/composer.json
index 4534259..ca84c58 100644
--- a/composer.json
+++ b/composer.json
@@ -1,9 +1,8 @@
{
"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",
+ "type": "library",
"keywords": [
"bdd",
"library",
@@ -16,41 +15,103 @@
"test double",
"testing"
],
- "homepage": "https://github.com/mockery/mockery",
- "license": "BSD-3-Clause",
"authors": [
{
"name": "Pádraic Brady",
"email": "padraic.brady@gmail.com",
- "homepage": "http://blog.astrumfutura.com"
+ "homepage": "https://github.com/padraic",
+ "role": "Author"
},
{
"name": "Dave Marshall",
"email": "dave.marshall@atstsolutions.co.uk",
- "homepage": "http://davedevelopment.co.uk"
+ "homepage": "https://davedevelopment.co.uk",
+ "role": "Developer"
+ },
+ {
+ "name": "Nathanael Esayeas",
+ "email": "nathanael.esayeas@protonmail.com",
+ "homepage": "https://github.com/ghostwriter",
+ "role": "Lead Developer"
}
],
+ "homepage": "https://github.com/mockery/mockery",
+ "support": {
+ "issues": "https://github.com/mockery/mockery/issues",
+ "source": "https://github.com/mockery/mockery",
+ "docs": "https://docs.mockery.io/",
+ "rss": "https://github.com/mockery/mockery/releases.atom",
+ "security": "https://github.com/mockery/mockery/security/advisories"
+ },
"require": {
- "php": ">=5.6.0",
+ "php": ">=7.3",
"lib-pcre": ">=7.0",
- "hamcrest/hamcrest-php": "~2.0"
+ "hamcrest/hamcrest-php": "^2.0.1"
},
"require-dev": {
- "phpunit/phpunit": "~5.7.10|~6.5|~7.0|~8.0"
+ "phpunit/phpunit": "^8.5 || ^9.6.17",
+ "symplify/easy-coding-standard": "^12.1.14"
+ },
+ "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": {
+ "Fixture\\": "tests/Fixture/",
+ "Mockery\\Tests\\Unit\\": "tests/Unit",
"test\\": "tests/"
- }
+ },
+ "files": [
+ "fixtures/autoload.php",
+ "vendor/hamcrest/hamcrest-php/hamcrest/Hamcrest.php"
+ ]
},
- "extra": {
- "branch-alias": {
- "dev-master": "1.0.x-dev"
- }
+ "config": {
+ "optimize-autoloader": true,
+ "platform": {
+ "php": "7.3.999"
+ },
+ "preferred-install": "dist",
+ "sort-packages": true
+ },
+ "scripts": {
+ "check": [
+ "@composer validate",
+ "@ecs",
+ "@test"
+ ],
+ "docs": "vendor/bin/phpdoc -d library -t docs/api",
+ "ecs": [
+ "@ecs:fix",
+ "@ecs:check"
+ ],
+ "ecs:check": "ecs check --clear-cache || true",
+ "ecs:fix": "ecs check --clear-cache --fix",
+ "phive": [
+ ".phive/tools/phive update --force-accept-unsigned",
+ ".phive/tools/phive purge"
+ ],
+ "phpunit": "vendor/bin/phpunit --do-not-cache-result --colors=always",
+ "phpunit:coverage": "@phpunit --coverage-clover=coverage.xml",
+ "psalm": ".phive/tools/psalm --no-diff --no-cache",
+ "psalm:baseline": "@psalm --set-baseline=psalm-baseline.xml",
+ "psalm:dry-run": "@psalm --alter --issues=all --dry-run",
+ "psalm:security": "@psalm --taint-analysis",
+ "psalm:shepherd": "@psalm --stats --shepherd --output-format=github",
+ "test": [
+ "@phpunit --stop-on-defect",
+ "@psalm",
+ "@psalm:security",
+ "@psalm:dry-run"
+ ]
}
}
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/php-mockery.spec b/php-mockery.spec
index 05251a8..28db6fc 100644
--- a/php-mockery.spec
+++ b/php-mockery.spec
@@ -7,60 +7,61 @@
#
# Please preserve changelog entries
#
-%global gh_commit dc4f10b6b1148744facb784015e4b339d7feec23
+%bcond_without tests
+
+%global gh_commit 81a161d0b135df89951abd52296adf97deb0723d
%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.2.1
+Version: 1.6.11
Release: 1%{?dist}
Summary: Mockery is a simple but flexible PHP mock object framework
-Group: Development/Libraries
-License: BSD
+License: BSD-3-Clause
URL: https://github.com/%{gh_owner}/%{gh_project}
-Source0: https://github.com/%{gh_owner}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz
+Source0: %{name}-%{version}-%{gh_short}.tgz
+Source1: makesrc.sh
# Use our autoloader
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.0|~8.0"
+# "phpunit/phpunit": "^8.5 || ^9.6.17",
+# "symplify/easy-coding-standard": "^12.1.4"
+%global phpunit %{_bindir}/phpunit9
+BuildRequires: phpunit9 >= 9.6.17
# remirepo:1
%if 0%{?fedora} >= 27 || 0%{?rhel} >= 8
-%global phpunit %{_bindir}/phpunit7
-BuildRequires: phpunit7
-BuildRequires: (php-composer(hamcrest/hamcrest-php) >= 2.0 with php-composer(hamcrest/hamcrest-php) < 3)
-# remirepo:5
+BuildRequires: (php-composer(hamcrest/hamcrest-php) >= 2.0.1 with php-composer(hamcrest/hamcrest-php) < 3)
+# remirepo:3
%else
-%global phpunit %{_bindir}/phpunit
-BuildRequires: php-phpunit-PHPUnit >= 5.7.10
-BuildRequires: php-hamcrest2
+BuildRequires: php-hamcrest2 >= 2.0.1
%endif
+BuildRequires: php-pdo
# Autoloader
%endif
BuildRequires: php-fedora-autoloader-devel
# From composer.json, "require": {
-# "php": ">=5.6.0",
+# "php": ">=7.3",
# "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 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
+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
@@ -88,10 +89,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
@@ -106,25 +108,23 @@ 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}
-phpab --output tests/classmap.php --exclude */SemiReservedWordsAsMethods.php tests/Mockery
+phpab --output tests/classmap.php --exclude */SemiReservedWordsAsMethods.php tests/Mockery tests/Fixture
: Run upstream test suite
ret=0
-for cmd in "php %{phpunit}" "php70 %{_bindir}/phpunit6" "php71 %{_bindir}/phpunit7" php72 php73; do
+
+# need investigation
+rm tests/Mockery/MockeryCanMockClassesWithSemiReservedWordsTest.php
+
+for cmd in php php81 php82 php83; 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"
- fi
- $1 ${2:-%{_bindir}/phpunit8} \
+ $cmd %{_bindir}/phpunit9 \
--no-coverage \
- --verbose --testsuite="$SUITE"
+ --verbose || ret=1
fi
done
exit $ret
@@ -141,6 +141,82 @@ exit $ret
%changelog
+* Fri Mar 22 2024 Remi Collet <remi@remirepo.net> - 1.6.11-1
+- update to 1.6.11
+
+* Wed Mar 20 2024 Remi Collet <remi@remirepo.net> - 1.6.10-1
+- update to 1.6.10
+
+* Wed Mar 13 2024 Remi Collet <remi@remirepo.net> - 1.6.9-1
+- update to 1.6.9 (revert to 1.6.7 code)
+
+* Tue Mar 12 2024 Remi Collet <remi@remirepo.net> - 1.6.8-1
+- update to 1.6.8
+
+* Mon Dec 11 2023 Remi Collet <remi@remirepo.net> - 1.6.7-1
+- update to 1.6.7
+
+* Thu Aug 24 2023 Remi Collet <remi@remirepo.net> - 1.6.6-1
+- update to 1.6.6
+
+* Thu Jul 20 2023 Remi Collet <remi@remirepo.net> - 1.6.4-1
+- update to 1.6.4
+
+* Wed Jul 19 2023 Remi Collet <remi@remirepo.net> - 1.6.3-1
+- update to 1.6.3
+
+* Thu Jun 8 2023 Remi Collet <remi@remirepo.net> - 1.6.2-1
+- update to 1.6.2
+
+* 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
+
+* Fri Jan 21 2022 Remi Collet <remi@remirepo.net> - 1.5.0-1
+- update to 1.5.0
+
+* Tue Sep 14 2021 Remi Collet <remi@remirepo.net> - 1.4.4-1
+- update to 1.4.4
+
+* Wed Feb 24 2021 Remi Collet <remi@remirepo.net> - 1.4.3-1
+- update to 1.4.3
+
+* 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
+- 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
+
+* Tue Jul 21 2020 Remi Collet <remi@remirepo.net> - 1.3.2-1
+- update to 1.3.2
+- switch to phpunit9
+- raise dependency on hamcrest/hamcrest-php 2.0.1
+- sources from git snapshot
+
+* Fri Jan 3 2020 Remi Collet <remi@remirepo.net> - 1.3.1-1
+- update to 1.3.1
+
+* Mon Nov 25 2019 Remi Collet <remi@remirepo.net> - 1.3.0-1
+- update to 1.3.0
+- use phpunit8
+
+* Mon Sep 30 2019 Remi Collet <remi@remirepo.net> - 1.2.4-1
+- update to 1.2.4
+- drop patch merged upstream
+
+* Mon Aug 19 2019 Remi Collet <remi@remirepo.net> - 1.2.3-1
+- update to 1.2.3
+- add patch for PHP 7.4 from
+ https://github.com/mockery/mockery/pull/993
+
+* Wed Feb 13 2019 Remi Collet <remi@remirepo.net> - 1.2.2-1
+- update to 1.2.2
+
* Mon Feb 11 2019 Remi Collet <remi@remirepo.net> - 1.2.1-1
- update to 1.2.1