summaryrefslogtreecommitdiffstats
path: root/phpunit9-rpm.patch
diff options
context:
space:
mode:
authorRemi Collet <remi@remirepo.net>2024-03-06 10:21:49 +0100
committerRemi Collet <remi@php.net>2024-03-06 10:21:49 +0100
commit20ceb296eb650fc7f2e7836c58262945b38d4d49 (patch)
tree14a09117569676dec20e5cbe80b8e9a9b37632c5 /phpunit9-rpm.patch
parentaa96b67f0c074f6f6e82c1014d5130a993cd3c03 (diff)
improve --check-version for RPM
Diffstat (limited to 'phpunit9-rpm.patch')
-rw-r--r--phpunit9-rpm.patch46
1 files changed, 37 insertions, 9 deletions
diff --git a/phpunit9-rpm.patch b/phpunit9-rpm.patch
index be09111..e9698bf 100644
--- a/phpunit9-rpm.patch
+++ b/phpunit9-rpm.patch
@@ -1,7 +1,7 @@
diff -up ./phpunit.rpm ./phpunit
---- ./phpunit.rpm 2021-12-30 09:04:15.000000000 +0100
-+++ ./phpunit 2021-12-30 09:05:07.774778660 +0100
-@@ -62,27 +62,11 @@ if (isset($GLOBALS['_composer_autoload_p
+--- ./phpunit.rpm 2024-02-26 09:34:48.000000000 +0100
++++ ./phpunit 2024-03-06 10:19:22.109376592 +0100
+@@ -71,27 +71,11 @@ if (isset($GLOBALS['_composer_autoload_p
define('PHPUNIT_COMPOSER_INSTALL', $GLOBALS['_composer_autoload_path']);
unset($GLOBALS['_composer_autoload_path']);
@@ -33,7 +33,7 @@ diff -up ./phpunit.rpm ./phpunit
}
$options = getopt('', array('prepend:'));
-@@ -95,4 +79,13 @@ unset($options);
+@@ -104,4 +88,13 @@ unset($options);
require PHPUNIT_COMPOSER_INSTALL;
@@ -48,10 +48,38 @@ diff -up ./phpunit.rpm ./phpunit
+ // PHPUnit v6 to v9
+ PHPUnit\TextUI\Command::main();
+}
+diff -up ./src/TextUI/Command.php.rpm ./src/TextUI/Command.php
+--- ./src/TextUI/Command.php.rpm 2024-03-06 10:19:26.914560422 +0100
++++ ./src/TextUI/Command.php 2024-03-06 10:19:32.787785106 +0100
+@@ -600,7 +600,7 @@ class Command
+ $this->printVersionString();
+
+ $latestVersion = file_get_contents('https://phar.phpunit.de/latest-version-of/phpunit');
+- $latestCompatibleVersion = file_get_contents('https://phar.phpunit.de/latest-version-of/phpunit-' . explode('.', Version::series())[0]);
++ $latestCompatibleVersion = file_get_contents('https://phar.phpunit.de/latest-version-of/phpunit-' . $major=explode('.', Version::series())[0]);
+
+ $notLatest = version_compare($latestVersion, Version::id(), '>');
+ $notLatestCompatible = version_compare($latestCompatibleVersion, Version::id(), '>');
+@@ -617,6 +617,7 @@ class Command
+ Version::id(),
+ $latestCompatibleVersion,
+ );
++ printf('Try a system update for new phpunit%s package.' . PHP_EOL, $major);
+ }
+
+ if ($notLatest) {
+@@ -624,6 +625,7 @@ class Command
+ 'The latest version is PHPUnit %s.' . PHP_EOL,
+ $latestVersion,
+ );
++ printf('Try to install and use the phpunit%s command.' . PHP_EOL, explode('.', $latestVersion)[0]);
+ }
+
+ exit(TestRunner::SUCCESS_EXIT);
diff -up ./src/Util/Xml/SchemaFinder.php.rpm ./src/Util/Xml/SchemaFinder.php
---- ./src/Util/Xml/SchemaFinder.php.rpm 2021-12-30 09:04:15.000000000 +0100
-+++ ./src/Util/Xml/SchemaFinder.php 2021-12-30 09:04:21.186910890 +0100
-@@ -48,6 +48,6 @@ final class SchemaFinder
+--- ./src/Util/Xml/SchemaFinder.php.rpm 2024-02-26 09:34:48.000000000 +0100
++++ ./src/Util/Xml/SchemaFinder.php 2024-03-06 10:19:22.109376592 +0100
+@@ -75,6 +75,6 @@ final class SchemaFinder
return __PHPUNIT_PHAR_ROOT__ . '/';
}
@@ -60,8 +88,8 @@ diff -up ./src/Util/Xml/SchemaFinder.php.rpm ./src/Util/Xml/SchemaFinder.php
}
}
diff -up ./tests/bootstrap.php.rpm ./tests/bootstrap.php
---- ./tests/bootstrap.php.rpm 2021-12-30 09:04:15.000000000 +0100
-+++ ./tests/bootstrap.php 2021-12-30 09:04:21.186910890 +0100
+--- ./tests/bootstrap.php.rpm 2024-02-26 09:34:48.000000000 +0100
++++ ./tests/bootstrap.php 2024-03-06 10:19:22.109376592 +0100
@@ -9,8 +9,8 @@
*/
const TEST_FILES_PATH = __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR;