summaryrefslogtreecommitdiffstatshomepage
path: root/tests/phpunit/includes/phpunit6
diff options
context:
space:
mode:
authorSergey Biryukov <sergeybiryukov@git.wordpress.org>2021-08-07 10:46:54 +0000
committerSergey Biryukov <sergeybiryukov@git.wordpress.org>2021-08-07 10:46:54 +0000
commitfcd4aa470069f6322b8e6cb7c90c9c71f1def2a9 (patch)
tree0fef35b656c495687ee261ef74ac2ac2f00444e9 /tests/phpunit/includes/phpunit6
parent22060f3b06444f5fc2ce7cd020f0941819a58392 (diff)
downloadwordpress-fcd4aa470069f6322b8e6cb7c90c9c71f1def2a9.tar.gz
wordpress-fcd4aa470069f6322b8e6cb7c90c9c71f1def2a9.zip
Build/Test Tools: Alias the `Getopt` class conditionally, as the class no longer exists in PHPUnit 9.x.
Most of the aliasing in this `compat.php` file is redundant as PHPUnit 5.7.21+ contains a forward compatibility layer for these classes anyway (= PHPUnit provides both the namespaced and underscore named versions of these classes in PHPUnit 5.7.21+). All the same, the file and the aliases are left in place for the time being, as plugins/themes using the WP test suite as the basis for their integration tests may rely on it, though WP itself should not really need it anymore, save for maybe one or two classes. Follow-up to [51559-51569]. Props jrf. See #46149. git-svn-id: https://develop.svn.wordpress.org/trunk@51570 602fd350-edb4-49c9-b593-d223f7449a82
Diffstat (limited to 'tests/phpunit/includes/phpunit6')
-rw-r--r--tests/phpunit/includes/phpunit6/compat.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/phpunit/includes/phpunit6/compat.php b/tests/phpunit/includes/phpunit6/compat.php
index dcc99e9a76..ec09a0c3fc 100644
--- a/tests/phpunit/includes/phpunit6/compat.php
+++ b/tests/phpunit/includes/phpunit6/compat.php
@@ -14,7 +14,9 @@ if ( class_exists( 'PHPUnit\Runner\Version' ) && version_compare( PHPUnit\Runner
class_alias( 'PHPUnit\Framework\TestSuite', 'PHPUnit_Framework_TestSuite' );
class_alias( 'PHPUnit\Framework\TestListener', 'PHPUnit_Framework_TestListener' );
class_alias( 'PHPUnit\Util\GlobalState', 'PHPUnit_Util_GlobalState' );
- class_alias( 'PHPUnit\Util\Getopt', 'PHPUnit_Util_Getopt' );
+ if ( class_exists( 'PHPUnit\Util\Getopt' ) ) {
+ class_alias( 'PHPUnit\Util\Getopt', 'PHPUnit_Util_Getopt' );
+ }
class PHPUnit_Util_Test {