mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-24 08:14:09 +00:00
Make tests pass on PHPUnit 8
Bug: T192167 Change-Id: Idf87f4c0f0d74848a0cc8f131a84c87e8eeb7809
This commit is contained in:
parent
6adb1c423b
commit
0d6a4da3d5
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue