Make tests pass on PHPUnit 8

Bug: T192167
Change-Id: Idf87f4c0f0d74848a0cc8f131a84c87e8eeb7809
This commit is contained in:
Max Semenik 2020-01-16 15:02:32 +03:00
parent 6adb1c423b
commit 0d6a4da3d5

View file

@ -66,7 +66,7 @@ trait Scribunto_LuaEngineTestHelper {
$engineSuite->setName( "$engineName: $className" );
foreach ( $class->getMethods() as $method ) {
if ( TestSuite::isTestMethod( $method ) && $method->isPublic() ) {
if ( self::isTestMethod( $method ) && $method->isPublic() ) {
$name = $method->getName();
$groups = Test::getGroups( $className, $name );
$groups[] = 'Lua';
@ -107,6 +107,23 @@ trait Scribunto_LuaEngineTestHelper {
return $suite;
}
/**
* Temporary helper for the duration of PHPUnit 8 migration
* @fixme Remove after migration is over
*
* @param ReflectionMethod $method
* @return bool
*/
private static function isTestMethod( ReflectionMethod $method ) : bool {
// PHPUnit 6
if ( method_exists( TestSuite::class, 'isTestMethod' ) ) {
return TestSuite::isTestMethod( $method );
}
// PHPUnit 8
return Test::isTestMethod( $method );
}
/**
* @return ScribuntoEngineBase
*/