mediawiki-extensions-Scribunto/tests/phpunit/engines/LuaCommon/UstringLibraryPureLuaTest.php
James D. Forrester 4a93593abf build: Upgrade mediawiki-codesniffer to v28.0.0
Change-Id: Ie4cb4cbee163943cd159eb0ad1d7deaac10e68d8
2019-10-11 11:31:29 -07:00

38 lines
867 B
PHP

<?php
require_once __DIR__ . '/UstringLibraryTest.php';
/**
* @coversNothing -- Covers Lua code
*/
class Scribunto_LuaUstringLibraryPureLuaTest extends Scribunto_LuaUstringLibraryTest {
protected function setUp() : void {
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 [
[ [], [], null ],
];
}
}