summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpunit7-comp.patch122
-rw-r--r--phpunit7-php8.patch344
-rw-r--r--phpunit7.spec104
3 files changed, 545 insertions, 25 deletions
diff --git a/phpunit7-comp.patch b/phpunit7-comp.patch
new file mode 100644
index 0000000..b30897f
--- /dev/null
+++ b/phpunit7-comp.patch
@@ -0,0 +1,122 @@
+Adapted for phpunit7 from
+
+
+From b439136ed5bdfc2abc1bbda8bd5922854c959a1f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= <mvorisek@mvorisek.cz>
+Date: Wed, 14 Sep 2022 15:50:39 +0200
+Subject: [PATCH] Drop comparison /w `PHP_FLOAT_EPSILON`
+
+---
+ src/Framework/Constraint/IsIdentical.php | 13 +------------
+ tests/unit/Framework/AssertTest.php | 22 +++++++++++++++++++---
+ 2 files changed, 20 insertions(+), 15 deletions(-)
+
+diff -up ./src/Framework/Constraint/IsIdentical.php.comp ./src/Framework/Constraint/IsIdentical.php
+--- ./src/Framework/Constraint/IsIdentical.php.comp 2022-09-26 09:33:03.170600127 +0200
++++ ./src/Framework/Constraint/IsIdentical.php 2022-09-26 09:35:13.452281355 +0200
+@@ -26,11 +26,6 @@ use SebastianBergmann\Comparator\Compari
+ class IsIdentical extends Constraint
+ {
+ /**
+- * @var float
+- */
+- private const EPSILON = 0.0000000001;
+-
+- /**
+ * @var mixed
+ */
+ private $value;
+@@ -61,13 +56,7 @@ class IsIdentical extends Constraint
+ */
+ public function evaluate($other, $description = '', $returnResult = false)
+ {
+- if (\is_float($this->value) && \is_float($other) &&
+- !\is_infinite($this->value) && !\is_infinite($other) &&
+- !\is_nan($this->value) && !\is_nan($other)) {
+- $success = \abs($this->value - $other) < self::EPSILON;
+- } else {
+- $success = $this->value === $other;
+- }
++ $success = $this->value === $other;
+
+ if ($returnResult) {
+ return $success;
+diff -up ./tests/unit/Framework/AssertTest.php.comp ./tests/unit/Framework/AssertTest.php
+--- ./tests/unit/Framework/AssertTest.php.comp 2022-09-26 09:33:03.170600127 +0200
++++ ./tests/unit/Framework/AssertTest.php 2022-09-26 09:37:39.752924997 +0200
+@@ -3099,8 +3099,13 @@ XML;
+ [0, 0],
+ // floats
+ [2.3, 2.3],
+- [1 / 3, 1 - 2 / 3],
+- [\log(0), \log(0)],
++ [1 / 3, 1 / 3],
++ [1 - 2 / 3, 1 - 2 / 3],
++ [5.5E+123, 5.5E+123],
++ [5.5E-123, 5.5E-123],
++ [log(0), log(0)],
++ [INF, INF],
++ [-INF, -INF],
+ // arrays
+ [[], []],
+ [[0 => 1], [0 => 1]],
+@@ -3156,6 +3161,12 @@ XML;
+ [[new \Struct(2.3)], [new \Struct(4.2)], 0.5],
+ // NAN
+ [\NAN, \NAN],
++ [1 / 3, 1 - 2 / 3],
++ [1 / 3, '0.33333333333333337'],
++ [1 - 2 / 3, '3333333333333333'],
++ [5.5E+123, 5.6E+123],
++ [5.5E-123, 5.6E-123],
++ [5.5E+123, 5.5E-123],
+ // arrays
+ [[], [0 => 1]],
+ [[0 => 1], []],
+@@ -3359,8 +3370,12 @@ XML;
+ ['0', 0],
+ [2.3, '2.3'],
+ ['2.3', 2.3],
+- [(string) (1 / 3), 1 - 2 / 3],
+- [1 / 3, (string) (1 - 2 / 3)],
++ [1, 1.0],
++ [1.0, '1'],
++ [1 / 3, '0.3333333333333333'],
++ [1 - 2 / 3, '0.33333333333333337'],
++ [5.5E+123, '5.5E+123'],
++ [5.5E-123, '5.5E-123'],
+ ['string representation', new \ClassWithToString],
+ [new \ClassWithToString, 'string representation'],
+ ];
+From 3e5a5d09ff2ece2fb41c0a462246956fd055407f Mon Sep 17 00:00:00 2001
+From: Sebastian Bergmann <sb@sebastian-bergmann.de>
+Date: Wed, 14 Sep 2022 08:56:29 +0200
+Subject: [PATCH] Delete test that expected wrong behaviour of
+ sebastian/comparator
+
+---
+ tests/unit/Framework/Constraint/IsEqualTest.php | 12 ------------
+ 1 file changed, 12 deletions(-)
+
+diff -up ./tests/unit/Framework/Constraint/IsEqualTest.php.comp ./tests/unit/Framework/Constraint/IsEqualTest.php
+--- ./tests/unit/Framework/Constraint/IsEqualTest.php.comp 2022-09-26 09:40:05.516578010 +0200
++++ ./tests/unit/Framework/Constraint/IsEqualTest.php 2022-09-26 09:41:35.658375993 +0200
+@@ -166,18 +166,6 @@ Failed asserting that two arrays are equ
+
+ EOF
+ ],
+- [[true], ['true'], <<<EOF
+-Failed asserting that two arrays are equal.
+---- Expected
+-+++ Actual
+-@@ @@
+- Array (
+-- 0 => true
+-+ 0 => 'true'
+- )
+-
+-EOF
+- ],
+ [[0, [1], [2], 3], [0, [4], [2], 3], <<<EOF
+ Failed asserting that two arrays are equal.
+ --- Expected
diff --git a/phpunit7-php8.patch b/phpunit7-php8.patch
new file mode 100644
index 0000000..998785f
--- /dev/null
+++ b/phpunit7-php8.patch
@@ -0,0 +1,344 @@
+diff -up ./src/Framework/MockObject/Builder/Match.php.php8 ./src/Framework/MockObject/Builder/Match.php
+--- ./src/Framework/MockObject/Builder/Match.php.php8 2020-01-08 09:45:45.000000000 +0100
++++ ./src/Framework/MockObject/Builder/Match.php 2021-03-26 14:22:46.505856216 +0100
+@@ -12,7 +12,7 @@ namespace PHPUnit\Framework\MockObject\B
+ /**
+ * Builder interface for invocation order matches.
+ */
+-interface Match extends Stub
++interface Match_ extends Stub
+ {
+ /**
+ * Defines the expectation which must occur before the current is valid.
+diff -up ./src/Framework/MockObject/Builder/NamespaceMatch.php.php8 ./src/Framework/MockObject/Builder/NamespaceMatch.php
+--- ./src/Framework/MockObject/Builder/NamespaceMatch.php.php8 2020-01-08 09:45:45.000000000 +0100
++++ ./src/Framework/MockObject/Builder/NamespaceMatch.php 2021-03-26 14:22:46.505856216 +0100
+@@ -33,5 +33,5 @@ interface NamespaceMatch
+ * @param string $id The identification of the match builder
+ * @param Match $builder The builder which is being registered
+ */
+- public function registerId($id, Match $builder);
++ public function registerId($id, Match_ $builder);
+ }
+diff -up ./src/Framework/MockObject/Builder/ParametersMatch.php.php8 ./src/Framework/MockObject/Builder/ParametersMatch.php
+--- ./src/Framework/MockObject/Builder/ParametersMatch.php.php8 2020-01-08 09:45:45.000000000 +0100
++++ ./src/Framework/MockObject/Builder/ParametersMatch.php 2021-03-26 14:22:46.505856216 +0100
+@@ -14,7 +14,7 @@ use PHPUnit\Framework\MockObject\Matcher
+ /**
+ * Builder interface for parameter matchers.
+ */
+-interface ParametersMatch extends Match
++interface ParametersMatch extends Match_
+ {
+ /**
+ * Sets the parameters to match for, each parameter to this function will
+diff -up ./src/Framework/MockObject/InvocationMocker.php.php8 ./src/Framework/MockObject/InvocationMocker.php
+--- ./src/Framework/MockObject/InvocationMocker.php.php8 2020-01-08 09:45:45.000000000 +0100
++++ ./src/Framework/MockObject/InvocationMocker.php 2021-03-26 14:22:46.505856216 +0100
+@@ -12,7 +12,7 @@ namespace PHPUnit\Framework\MockObject;
+ use Exception;
+ use PHPUnit\Framework\ExpectationFailedException;
+ use PHPUnit\Framework\MockObject\Builder\InvocationMocker as BuilderInvocationMocker;
+-use PHPUnit\Framework\MockObject\Builder\Match;
++use PHPUnit\Framework\MockObject\Builder\Match_;
+ use PHPUnit\Framework\MockObject\Builder\NamespaceMatch;
+ use PHPUnit\Framework\MockObject\Matcher\DeferredError;
+ use PHPUnit\Framework\MockObject\Matcher\Invocation as MatcherInvocation;
+@@ -82,7 +82,7 @@ class InvocationMocker implements Invoka
+ /**
+ * @throws RuntimeException
+ */
+- public function registerId($id, Match $builder): void
++ public function registerId($id, Match_ $builder): void
+ {
+ if (isset($this->builderMap[$id])) {
+ throw new RuntimeException(
+diff -up ./src/Framework/MockObject/MockMethod.php.php8 ./src/Framework/MockObject/MockMethod.php
+--- ./src/Framework/MockObject/MockMethod.php.php8 2020-01-08 09:45:45.000000000 +0100
++++ ./src/Framework/MockObject/MockMethod.php 2021-03-26 14:23:49.737575694 +0100
+@@ -12,6 +12,7 @@ namespace PHPUnit\Framework\MockObject;
+ use ReflectionClass;
+ use ReflectionException;
+ use ReflectionMethod;
++use ReflectionNamedType;
+ use Text_Template;
+
+ final class MockMethod
+@@ -269,7 +270,7 @@ final class MockMethod
+ *
+ * @throws RuntimeException
+ */
+- private static function getMethodParameters(ReflectionMethod $method, bool $forCall = false): string
++ private static function getMethodParametersForDeclaration(ReflectionMethod $method): string
+ {
+ $parameters = [];
+
+@@ -283,63 +284,38 @@ final class MockMethod
+ $name = '$arg' . $i;
+ }
+
+- if ($parameter->isVariadic()) {
+- if ($forCall) {
+- continue;
+- }
+-
+- $name = '...' . $name;
+- }
+-
+ $nullable = '';
+ $default = '';
+ $reference = '';
+ $typeDeclaration = '';
++ $type = null;
++ $typeName = null;
+
+- if (!$forCall) {
+- if ($parameter->hasType() && $parameter->allowsNull()) {
+- $nullable = '?';
++ if ($parameter->hasType()) {
++ $type = $parameter->getType();
++
++ if ($type instanceof ReflectionNamedType) {
++ $typeName = $type->getName();
+ }
++ }
++
++ if ($parameter->isVariadic()) {
++ $name = '...' . $name;
++ } elseif ($parameter->isDefaultValueAvailable()) {
++ $default = ' = ' . var_export($parameter->getDefaultValue(), true);
++ } elseif ($parameter->isOptional()) {
++ $default = ' = null';
++ }
+
+- if ($parameter->hasType() && $parameter->getType()->getName() !== 'self') {
+- $typeDeclaration = $parameter->getType()->getName() . ' ';
+- } else {
+- try {
+- $class = $parameter->getClass();
+- } catch (ReflectionException $e) {
+- throw new RuntimeException(
+- \sprintf(
+- 'Cannot mock %s::%s() because a class or ' .
+- 'interface used in the signature is not loaded',
+- $method->getDeclaringClass()->getName(),
+- $method->getName()
+- ),
+- 0,
+- $e
+- );
+- }
+-
+- if ($class !== null) {
+- $typeDeclaration = $class->getName() . ' ';
+- }
++ if ($type !== null) {
++ if ($typeName !== 'mixed' && $parameter->allowsNull()) {
++ $nullable = '?';
+ }
+
+- if (!$parameter->isVariadic()) {
+- if ($parameter->isDefaultValueAvailable()) {
+- try {
+- $value = \var_export($parameter->getDefaultValue(), true);
+- } catch (\ReflectionException $e) {
+- throw new RuntimeException(
+- $e->getMessage(),
+- (int) $e->getCode(),
+- $e
+- );
+- }
+-
+- $default = ' = ' . $value;
+- } elseif ($parameter->isOptional()) {
+- $default = ' = null';
+- }
++ if ($typeName === 'self') {
++ $typeDeclaration = $method->getDeclaringClass()->getName() . ' ';
++ } elseif ($typeName !== null) {
++ $typeDeclaration = $typeName . ' ';
+ }
+ }
+
+@@ -350,6 +326,53 @@ final class MockMethod
+ $parameters[] = $nullable . $typeDeclaration . $reference . $name . $default;
+ }
+
+- return \implode(', ', $parameters);
++ return implode(', ', $parameters);
++ }
++
++ /**
++ * Returns the parameters of a function or method.
++ *
++ * @throws ReflectionException
++ */
++ private static function getMethodParametersForCall(ReflectionMethod $method): string
++ {
++ $parameters = [];
++
++ foreach ($method->getParameters() as $i => $parameter) {
++ $name = '$' . $parameter->getName();
++
++ /* Note: PHP extensions may use empty names for reference arguments
++ * or "..." for methods taking a variable number of arguments.
++ */
++ if ($name === '$' || $name === '$...') {
++ $name = '$arg' . $i;
++ }
++
++ if ($parameter->isVariadic()) {
++ continue;
++ }
++
++ if ($parameter->isPassedByReference()) {
++ $parameters[] = '&' . $name;
++ } else {
++ $parameters[] = $name;
++ }
++ }
++
++ return implode(', ', $parameters);
++ }
++
++
++ /**
++ * Returns the parameters of a function or method.
++ *
++ * @throws RuntimeException
++ */
++ private static function getMethodParameters(ReflectionMethod $method, bool $forCall = false): string
++ {
++ if ($forCall) {
++ return self::getMethodParametersForCall($method);
++ }
++ return self::getMethodParametersForDeclaration($method);
+ }
+ }
+diff -up ./tests/_files/SingletonClass.php.php8 ./tests/_files/SingletonClass.php
+--- ./tests/_files/SingletonClass.php.php8 2020-01-08 09:45:45.000000000 +0100
++++ ./tests/_files/SingletonClass.php 2021-03-26 14:22:46.505856216 +0100
+@@ -17,11 +17,11 @@ class SingletonClass
+ {
+ }
+
+- private function __sleep()
++ function __sleep()
+ {
+ }
+
+- private function __wakeup()
++ function __wakeup()
+ {
+ }
+
+diff -up ./tests/unit/Framework/Constraint/IsTypeTest.php.php8 ./tests/unit/Framework/Constraint/IsTypeTest.php
+--- ./tests/unit/Framework/Constraint/IsTypeTest.php.php8 2020-01-08 09:45:45.000000000 +0100
++++ ./tests/unit/Framework/Constraint/IsTypeTest.php 2021-03-26 14:22:46.505856216 +0100
+@@ -74,7 +74,7 @@ EOF
+
+ $this->assertTrue($constraint->evaluate($resource, '', true));
+
+- @\fclose($resource);
++ if (is_resource($resource)) @\fclose($resource);
+ }
+
+ public function resources()
+diff -up ./tests/unit/Framework/Constraint/JsonMatchesErrorMessageProviderTest.php.php8 ./tests/unit/Framework/Constraint/JsonMatchesErrorMessageProviderTest.php
+--- ./tests/unit/Framework/Constraint/JsonMatchesErrorMessageProviderTest.php.php8 2020-01-08 09:45:45.000000000 +0100
++++ ./tests/unit/Framework/Constraint/JsonMatchesErrorMessageProviderTest.php 2021-03-26 14:22:46.505856216 +0100
+@@ -17,7 +17,7 @@ class JsonMatchesErrorMessageProviderTes
+ {
+ return [
+ 'JSON_ERROR_NONE' => [
+- null, 'json_error_none', '',
++ null, \JSON_ERROR_NONE, '',
+ ],
+ 'JSON_ERROR_DEPTH' => [
+ 'Maximum stack depth exceeded', \JSON_ERROR_DEPTH, '',
+diff -up ./src/Util/Configuration.php.old ./src/Util/Configuration.php
+--- ./src/Util/Configuration.php.old 2021-09-10 08:26:04.654231054 +0200
++++ ./src/Util/Configuration.php 2021-09-10 08:27:14.019129699 +0200
+@@ -567,24 +567,27 @@ final class Configuration
+ */
+ switch ($array) {
+ case 'var':
+- $target = &$GLOBALS;
++ foreach ($configuration[$array] as $name => $data) {
++ $GLOBALS[$name] = $data['value'];
++ }
+
+ break;
+
+ case 'server':
+- $target = &$_SERVER;
++ foreach ($configuration[$array] as $name => $data) {
++ $_SERVER[$name] = $data['value'];
++ }
+
+ break;
+
+ default:
+- $target = &$GLOBALS['_' . \strtoupper($array)];
++ foreach ($configuration[$array] as $name => $data) {
++ $GLOBALS['_' . \strtoupper($array)][$name] = $data['value'];
++ }
+
+ break;
+ }
+
+- foreach ($configuration[$array] as $name => $data) {
+- $target[$name] = $data['value'];
+- }
+ }
+
+ foreach ($configuration['env'] as $name => $data) {
+diff -up ./src/Util/PHP/Template/TestCaseClass.tpl.dist.old ./src/Util/PHP/Template/TestCaseClass.tpl.dist
+--- ./src/Util/PHP/Template/TestCaseClass.tpl.dist.old 2021-09-10 08:26:32.213191401 +0200
++++ ./src/Util/PHP/Template/TestCaseClass.tpl.dist 2021-09-10 08:26:55.407157223 +0200
+@@ -87,7 +87,7 @@ if ('' !== $configurationFilePath) {
+ unset($configuration);
+ }
+
+-function __phpunit_error_handler($errno, $errstr, $errfile, $errline, $errcontext)
++function __phpunit_error_handler($errno, $errstr, $errfile, $errline, $errcontext=null)
+ {
+ return true;
+ }
+diff -up ./src/Util/PHP/Template/TestCaseMethod.tpl.dist.old ./src/Util/PHP/Template/TestCaseMethod.tpl.dist
+--- ./src/Util/PHP/Template/TestCaseMethod.tpl.dist.old 2021-09-10 08:26:26.609199466 +0200
++++ ./src/Util/PHP/Template/TestCaseMethod.tpl.dist 2021-09-10 08:26:48.235167829 +0200
+@@ -89,7 +89,7 @@ if ('' !== $configurationFilePath) {
+ unset($configuration);
+ }
+
+-function __phpunit_error_handler($errno, $errstr, $errfile, $errline, $errcontext)
++function __phpunit_error_handler($errno, $errstr, $errfile, $errline, $errcontext=null)
+ {
+ return true;
+ }
+diff -up ./src/Framework/Constraint/IsType.php.old ./src/Framework/Constraint/IsType.php
+--- ./src/Framework/Constraint/IsType.php.old 2021-11-23 07:43:17.366683633 +0100
++++ ./src/Framework/Constraint/IsType.php 2021-11-23 07:43:35.332633310 +0100
+@@ -137,7 +137,20 @@ class IsType extends Constraint
+ return \is_object($other);
+
+ case 'resource':
+- return \is_resource($other) || \is_string(@\get_resource_type($other));
++ if (is_resource($other)) {
++ return true;
++ }
++
++ try {
++ $resource = @get_resource_type($other);
++
++ if (is_string($resource)) {
++ return true;
++ }
++ } catch (\TypeError $e) {
++ }
++
++ return false;
+
+ case 'scalar':
+ return \is_scalar($other);
diff --git a/phpunit7.spec b/phpunit7.spec
index c11a8fc..2858e02 100644
--- a/phpunit7.spec
+++ b/phpunit7.spec
@@ -1,17 +1,18 @@
# remirepo/fedora spec file for phpunit7
#
-# Copyright (c) 2010-2020 Remi Collet
+# Copyright (c) 2010-2023 Remi Collet
#
-# License: CC-BY-SA
+# License: CC-BY-SA-4.0
# http://creativecommons.org/licenses/by-sa/4.0/
#
# Please, preserve the changelog entries
#
+# remirepo:2
# For compatibility with SCL
%undefine __brp_mangle_shebangs
-%global gh_commit 4263f76a3fc65385e242ef7357b99f3bed36707e
+%global gh_commit 9467db479d1b0487c99733bb1e7944d32deded2c
#global gh_date 20150927
%global gh_short %(c=%{gh_commit}; echo ${c:0:7})
%global gh_vendor sebastianbergmann
@@ -24,20 +25,23 @@
%global php_home %{_datadir}/php
%global ver_major 7
%global ver_minor 5
-%global ver_patch 19
-%global specrel 1
+%global ver_patch 20
Name: %{pk_project}%{ver_major}
Version: %{ver_major}.%{ver_minor}.%{ver_patch}
-Release: %{?gh_date:1%{specrel}.%{?prever}%{!?prever:%{gh_date}git%{gh_short}}}%{!?gh_date:%{specrel}}%{?dist}
+Release: 13%{?dist}
Summary: The PHP Unit Testing framework version %{ver_major}
-License: BSD
+License: BSD-3-Clause
URL: https://github.com/%{gh_vendor}/%{gh_project}
Source0: https://github.com/%{gh_vendor}/%{gh_project}/archive/%{gh_commit}/%{name}-%{version}-%{gh_short}.tar.gz
# Fix command for autoload
Patch0: %{name}-rpm.patch
+# Minimal fix for PHP 8
+Patch1: %{name}-php8.patch
+# Fix for new comparator
+Patch2: %{name}-comp.patch
BuildArch: noarch
BuildRequires: php(language) >= 7.1
@@ -63,8 +67,8 @@ BuildRequires: (php-composer(sebastian/version) >= 2.0.1 with php-co
BuildRequires: (php-composer(phpunit/php-invoker) >= 2.0 with php-composer(phpunit/php-invoker) < 3)
# remirepo:20
%else
-BuildRequires: php-doctrine-instantiator11
-BuildRequires: php-myclabs-deep-copy19
+BuildRequires: php-doctrine-instantiator >= 1.1
+BuildRequires: php-myclabs-deep-copy >= 1.7
BuildRequires: php-phar-io-manifest >= 1.0.1
BuildRequires: php-phar-io-version >= 1.0
BuildRequires: php-phpspec-prophecy >= 1.7
@@ -145,10 +149,13 @@ Requires: (php-composer(sebastian/version) >= 2.0.1 with php-co
# "phpunit/php-invoker": "^2.0",
# "ext-xdebug": "*"
Requires: (php-composer(phpunit/php-invoker) >= 2.0 with php-composer(phpunit/php-invoker) < 3)
+# Supported versions
+Recommends: phpunit8
+Recommends: phpunit9
# remirepo:20
%else
-Requires: php-doctrine-instantiator11
-Requires: php-myclabs-deep-copy19
+Requires: php-doctrine-instantiator >= 1.1
+Requires: php-myclabs-deep-copy >= 1.7
Requires: php-phar-io-manifest >= 1.0.1
Requires: php-phar-io-version >= 1.0
Requires: php-phpspec-prophecy >= 1.7
@@ -178,6 +185,11 @@ Requires: php-spl
# projects have been merged
Obsoletes: php-phpunit-mock-objects6 < 6.1.3
+%if 0%{?fedora} >= 39 || 0%{?rhel} >= 10
+Provides: php-composer(phpunit/phpunit) = %{version}
+Provides: phpunit = %{version}-%{release}
+%endif
+
%description
PHPUnit is a programmer-oriented testing framework for PHP.
@@ -186,12 +198,21 @@ It is an instance of the xUnit architecture for unit testing frameworks.
This package provides the version %{ver_major} of PHPUnit,
available using the %{name} command.
+This version have reached its end of life in Feb 2020,
+so consider using a supported version,
+see https://phpunit.de/supported-versions.html
+
Documentation: https://phpunit.readthedocs.io/
%prep
%setup -q -n %{gh_project}-%{gh_commit}
-%patch0 -p0 -b .rpm
+%patch -P0 -p1 -b .rpm
+%patch -P1 -p1 -b .php8
+%patch -P2 -p1 -b .comp
+
+find . -name \*.php8 -delete -print
+find . -name \*.comp -delete -print
%build
@@ -207,7 +228,6 @@ cat << 'EOF' | tee -a src/autoload.php
'%{php_home}/Text/Template/Autoload.php',
'%{php_home}/SebastianBergmann/CodeCoverage6/autoload.php',
'%{php_home}/SebastianBergmann/Timer/autoload.php',
- '%{php_home}/Prophecy/autoload.php',
'%{php_home}/SebastianBergmann/Diff3/autoload.php', // Before comparator which may load v2
'%{php_home}/SebastianBergmann/Comparator3/autoload.php',
'%{php_home}/SebastianBergmann/Environment4/autoload.php',
@@ -216,17 +236,13 @@ cat << 'EOF' | tee -a src/autoload.php
'%{php_home}/SebastianBergmann/ObjectEnumerator3/autoload.php',
'%{php_home}/SebastianBergmann/ResourceOperations2/autoload.php',
'%{php_home}/SebastianBergmann/Version/autoload.php',
- [
- '%{php_home}/Doctrine/Instantiator11/autoload.php',
- '%{php_home}/Doctrine/Instantiator/autoload.php',
- ],
- [
- '%{php_home}/DeepCopy19/autoload.php',
- '%{php_home}/DeepCopy/autoload.php',
- ],
+ '%{php_home}/Doctrine/Instantiator/autoload.php',
+ '%{php_home}/DeepCopy/autoload.php',
'%{php_home}/SebastianBergmann/Invoker/autoload.php',
'%{php_home}/PharIo/Manifest/autoload.php',
'%{php_home}/PharIo/Version/autoload.php',
+ // May load Comparator/RecursionContext bad version
+ '%{php_home}/Prophecy/autoload.php',
]);
// Extensions
\Fedora\Autoloader\Dependencies::optional([
@@ -252,15 +268,26 @@ install -p -m 644 phpunit.xsd %{buildroot}%{php_home}/%{ns_vendor}/phpunit.xsd
%check
-OPT="--testsuite=unit --no-coverage"
sed -e 's:@PATH@:%{buildroot}%{php_home}/%{ns_vendor}:' -i tests/bootstrap.php
sed -e 's:%{php_home}/%{ns_vendor}:%{buildroot}%{php_home}/%{ns_vendor}:' -i phpunit
ret=0
-for cmd in php php71 php72 php73 php74; do
+for cmd in php php81 php82 php83; do
if which $cmd; then
- if [ $($cmd -r 'echo PHP_VERSION_ID;') -ge 70400 ]; then
- OPT="$OPT --filter '^((?!(testStaticAttributesBackupPre)).)*$'"
+ OPT="--testsuite=unit --no-coverage"
+ VER=$($cmd -r 'echo PHP_VERSION_ID;');
+
+ if [ $VER -ge 70400 ]; then
+ FILTER="testStaticAttributesBackupPre"
+ fi
+ if [ $VER -ge 80000 ]; then
+ FILTER="$FILTER|testCountTraversable|testConstraintTraversableCheckForObjectIdentityForDefaultCase"
+ fi
+ if [ $VER -ge 80300 ]; then
+ FILTER="$FILTER|testMessageXdebugScreamCompatibility|testGetOriginalException|testNoOriginalExceptionInStacktrace|testIsInIsolationReturnsTrue"
+ fi
+ if [ -n "$FILTER" ]; then
+ OPT="$OPT --filter '^((?!($FILTER)).)*$'"
fi
$cmd ./phpunit $OPT --verbose || ret=1
fi
@@ -279,6 +306,33 @@ exit $ret
%changelog
+* Fri Dec 22 2023 Remi Collet <remi@remirepo.net> - 7.5.20-13
+- fix possible autoloader issue with phpspec/prophecy
+
+* Mon Sep 26 2022 Remi Collet <remi@remirepo.net> - 7.5.20-11
+- backport upstream fix for new sebastian/comparator
+
+* Tue Nov 23 2021 Remi Collet <remi@remirepo.net> - 7.5.20-8
+- additional fix for PHP 8
+
+* Fri Sep 10 2021 Remi Collet <remi@remirepo.net> - 7.5.20-7
+- add minimal patch for PHP 8.1
+
+* Fri Mar 26 2021 Remi Collet <remi@remirepo.net> - 7.5.20-5
+- more fix for PHP 8
+
+* Thu Mar 25 2021 Remi Collet <remi@remirepo.net> - 7.5.20-4
+- recommend using a supported version
+
+* Wed Mar 24 2021 Remi Collet <remi@remirepo.net> - 7.5.20-3
+- add minimal patch for PHP 8 and ignore some tests
+
+* Mon Jun 29 2020 Remi Collet <remi@remirepo.net> - 7.5.20-2
+- cleanup dependencies
+
+* Wed Jan 8 2020 Remi Collet <remi@remirepo.net> - 7.5.20-1
+- update to 7.5.20
+
* Tue Jan 7 2020 Remi Collet <remi@remirepo.net> - 7.5.19-1
- update to 7.5.19