13 use MediaWikiCoversValidator;
14 use PHPUnit4And6Compat;
47 $name =
null, array $data = [], $dataName =
'',
$engineName =
null
53 parent::__construct( $name, $data, $dataName );
56 public static function suite( $className ) {
61 if ( $this->luaDataProvider ) {
62 $this->luaDataProvider->destroy();
63 $this->luaDataProvider =
null;
65 if ( $this->engine ) {
66 $this->engine->destroy();
75 if ( $this->luaTestName ) {
78 return $this->engineName .
': ' . parent::toString();
83 'TestFramework' => __DIR__ .
'/TestFramework.lua',
88 if ( !$this->luaDataProvider ) {
89 $class = static::$dataProviderClass;
90 $this->luaDataProvider =
new $class ( $this->
getEngine(), static::$moduleName );
101 public function testLua( $key, $testName, $expected ) {
102 $this->luaTestName = static::$moduleName .
"[$key]: $testName";
103 if ( isset( $this->skipTests[$testName] ) ) {
104 $this->markTestSkipped( $this->skipTests[$testName] );
115 $this->assertSame( $expected, $actual );
117 $this->luaTestName =
null;
static makeSuite( $className, $group=null)
trait Scribunto_LuaEngineTestHelper
Trait that helps LuaEngineTestBase and LuaEngineUnitTestBase.
This is the subclass for Lua library tests.
static suite( $className)
static string $moduleName
Name of the module being tested.
__construct( $name=null, array $data=[], $dataName='', $engineName=null)
array $skipTests
Tests to skip.
static string $dataProviderClass
Class to use for the data provider.
string $luaTestName
Name to display instead of the default.
testLua( $key, $testName, $expected)
@dataProvider provideLuaData