mediawiki-extensions-Scribunto/tests/engines/LuaCommon/UstringLibraryPureLuaTest.php
Brad Jorsch ba19a82c06 Add handling for PCRE errors in ustringGsub
Bug: T130823
Change-Id: I6fab71c82ddab92daf6b369cb9857d9892f2d246
2016-07-15 15:43:58 -04:00

36 lines
909 B
PHP

<?php
require_once __DIR__ . '/UstringLibraryTest.php';
// @codingStandardsIgnoreLine Squiz.Classes.ValidClassName.NotCamelCaps
class Scribunto_LuaUstringLibraryPureLuaTests extends Scribunto_LuaUstringLibraryTests {
protected function setUp() {
parent::setUp();
// Override mw.ustring with the pure-Lua version
$interpreter = $this->getEngine()->getInterpreter();
$interpreter->callFunction(
$interpreter->loadString( '
local ustring = require( "ustring" )
ustring.maxStringLength = mw.ustring.maxStringLength
ustring.maxPatternLength = mw.ustring.maxPatternLength
mw.ustring = ustring
', 'fortest' )
);
}
/**
* @dataProvider providePCREErrors
*/
public function testPCREErrors( $ini, $args, $error ) {
// Not applicable
$this->assertTrue( true );
}
public static function providePCREErrors() {
return array(
array( array(), array(), null ),
);
}
}