X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fphpunit.php;h=efde4c010374c175e6d7939c4ed12199c3fd434b;hb=1747b121776a150ac5f42c41355c284fe208140f;hp=e59b506370d50c017b94fbb292661596626c4d7c;hpb=478272b6e5f1da3a37534d76f6c1b4ebc7c2fa52;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/phpunit.php b/tests/phpunit/phpunit.php index e59b506370..efde4c0103 100755 --- a/tests/phpunit/phpunit.php +++ b/tests/phpunit/phpunit.php @@ -215,25 +215,35 @@ if ( version_compare( PHP_VERSION, '5.4.0', '<' ) ) { $ok = false; -foreach ( array( - stream_resolve_include_path( 'phpunit.phar' ), - 'PHPUnit/Runner/Version.php', - 'PHPUnit/Autoload.php' -) as $includePath ) { - @include_once $includePath; - if ( class_exists( 'PHPUnit_TextUI_Command' ) ) { - $ok = true; - break; +if ( class_exists( 'PHPUnit_TextUI_Command' ) ) { + echo "PHPUnit already present\n"; + $ok = true; +} else { + foreach ( array( + stream_resolve_include_path( 'phpunit.phar' ), + 'PHPUnit/Runner/Version.php', + 'PHPUnit/Autoload.php' + ) as $includePath ) { + // @codingStandardsIgnoreStart + @include_once $includePath; + // @codingStandardsIgnoreEnd + if ( class_exists( 'PHPUnit_TextUI_Command' ) ) { + $ok = true; + echo "Using PHPUnit from $includePath\n"; + break; + } } } if ( !$ok ) { - die( "Couldn't find a usable PHPUnit.\n" ); + echo "Couldn't find a usable PHPUnit.\n"; + exit( 1 ); } $puVersion = PHPUnit_Runner_Version::id(); if ( $puVersion !== '@package_version@' && version_compare( $puVersion, '3.7.0', '<' ) ) { - die( "PHPUnit 3.7.0 or later required; you have {$puVersion}.\n" ); + echo "PHPUnit 3.7.0 or later required; you have {$puVersion}.\n"; + exit( 1 ); } PHPUnit_TextUI_Command::main();