mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2025-10-16 12:05:38 +00:00
Tests: Improve PHPUnit version retrieval.
Always test for newer class names first and fall back to the older. This improves compatibility when running PHPUnit via a phar while there is also a Composer-installed version of PHPUnit on the system. Props jrf. See #52625. git-svn-id: https://develop.svn.wordpress.org/trunk@50982 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
c3ef52ded7
commit
479ea22b8e
@ -7,10 +7,10 @@ require_once __DIR__ . '/class-basic-object.php';
|
||||
* @return double The version number.
|
||||
*/
|
||||
function tests_get_phpunit_version() {
|
||||
if ( class_exists( 'PHPUnit_Runner_Version' ) ) {
|
||||
$version = PHPUnit_Runner_Version::id();
|
||||
} elseif ( class_exists( 'PHPUnit\Runner\Version' ) ) {
|
||||
if ( class_exists( 'PHPUnit\Runner\Version' ) ) {
|
||||
$version = PHPUnit\Runner\Version::id();
|
||||
} elseif ( class_exists( 'PHPUnit_Runner_Version' ) ) {
|
||||
$version = PHPUnit_Runner_Version::id();
|
||||
} else {
|
||||
$version = 0;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user