45 $name =
null, array $data = [], $dataName =
'',
$engineName =
null
51 parent::__construct( $name, $data, $dataName );
54 public static function suite( $className ) {
59 if ( $this->luaDataProvider ) {
60 $this->luaDataProvider->destroy();
61 $this->luaDataProvider =
null;
63 if ( $this->engine ) {
64 $this->engine->destroy();
76 return Title::newMainPage();
82 if ( $this->luaTestName ) {
85 return $this->engineName .
': ' . parent::toString();
90 'TestFramework' => __DIR__ .
'/TestFramework.lua',
95 if ( !$this->luaDataProvider ) {
96 $class = static::$dataProviderClass;
97 $this->luaDataProvider =
new $class ( $this->
getEngine(), static::$moduleName );
108 public function testLua( $key, $testName, $expected ) {
109 $this->luaTestName = static::$moduleName .
"[$key]: $testName";
110 if ( isset( $this->skipTests[$testName] ) ) {
111 $this->markTestSkipped( $this->skipTests[$testName] );
122 $this->assertSame( $expected, $actual );
124 $this->luaTestName =
null;
135 parent::__construct(
'testDummy' );
139 if ( $this->className ) {
140 $this->markTestSkipped( $this->message );
143 $this->assertTrue(
true );
static makeSuite( $className, $group=null)
trait Scribunto_LuaEngineTestHelper
Trait that helps LuaEngineTestBase and LuaEngineUnitTestBase.
This is the subclass for Lua library tests.
__construct( $name=null, array $data=[], $dataName='', $engineName=null)
static suite( $className)
getTestTitle()
Get the title used for unit tests.
testLua( $key, $testName, $expected)
@dataProvider provideLuaData
static string $dataProviderClass
Class to use for the data provider.
static string $moduleName
Name of the module being tested.
array $skipTests
Tests to skip.
string $luaTestName
Name to display instead of the default.
__construct( $className='', $message='')