From ce46700ec9f4ea1ec8052d9d1a8a4d06e6f3ee06 Mon Sep 17 00:00:00 2001 From: Brad Jorsch Date: Thu, 7 Feb 2013 15:59:38 -0500 Subject: [PATCH] Fix unit tests after I62259b76 The unit tests never set the title on the engine. Change-Id: Iefa11cacd4f10a1daa185b2e2a0d9620bbbfa6c6 --- tests/engines/LuaCommon/LuaEngineTestBase.php | 2 ++ tests/engines/LuaCommon/LuaEnvironmentComparisonTest.php | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/engines/LuaCommon/LuaEngineTestBase.php b/tests/engines/LuaCommon/LuaEngineTestBase.php index 7e7adb43..1fb93100 100644 --- a/tests/engines/LuaCommon/LuaEngineTestBase.php +++ b/tests/engines/LuaCommon/LuaEngineTestBase.php @@ -78,6 +78,7 @@ abstract class Scribunto_LuaEngineTestBase extends MediaWikiTestCase { $engine = new $engineClass( self::$engineConfigurations[$engineName] + array( 'parser' => $parser ) ); + $engine->setTitle( $parser->getTitle() ); $engine->getInterpreter(); } catch ( Scribunto_LuaInterpreterNotFoundError $e ) { $suite->addTest( @@ -161,6 +162,7 @@ abstract class Scribunto_LuaEngineTestBase extends MediaWikiTestCase { $this->engine = new $class( self::$engineConfigurations[$this->engineName] + array( 'parser' => $parser ) ); + $this->engine->setTitle( $parser->getTitle() ); } return $this->engine; } diff --git a/tests/engines/LuaCommon/LuaEnvironmentComparisonTest.php b/tests/engines/LuaCommon/LuaEnvironmentComparisonTest.php index a77b0044..4fb1017f 100644 --- a/tests/engines/LuaCommon/LuaEnvironmentComparisonTest.php +++ b/tests/engines/LuaCommon/LuaEnvironmentComparisonTest.php @@ -28,6 +28,7 @@ class Scribunto_LuaEnvironmentComparisonTest extends MediaWikiTestCase { $engine = new Scribunto_LuaSandboxEngine( array( 'parser' => $parser ) + $this->sandboxOpts ); + $engine->setTitle( $parser->getTitle() ); $engine->getInterpreter(); $this->engines['LuaSandbox'] = $engine; } catch ( Scribunto_LuaInterpreterNotFoundError $e ) { @@ -39,6 +40,7 @@ class Scribunto_LuaEnvironmentComparisonTest extends MediaWikiTestCase { $engine = new Scribunto_LuaStandaloneEngine( array( 'parser' => $parser ) + $this->standaloneOpts ); + $engine->setTitle( $parser->getTitle() ); $engine->getInterpreter(); $this->engines['LuaStandalone'] = $engine; } catch ( Scribunto_LuaInterpreterNotFoundError $e ) {