2014-07-10 19:21:58 +00:00
|
|
|
<?php
|
|
|
|
|
2019-12-18 20:12:45 +00:00
|
|
|
require_once __DIR__ . '/LuaUstringLibraryTest.php';
|
2014-07-10 19:21:58 +00:00
|
|
|
|
2018-05-27 00:50:43 +00:00
|
|
|
/**
|
|
|
|
* @coversNothing -- Covers Lua code
|
|
|
|
*/
|
2018-03-10 13:15:42 +00:00
|
|
|
class Scribunto_LuaUstringLibraryPureLuaTest extends Scribunto_LuaUstringLibraryTest {
|
2021-07-23 10:49:13 +00:00
|
|
|
protected function setUp(): void {
|
2014-07-10 19:21:58 +00:00
|
|
|
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' )
|
|
|
|
);
|
|
|
|
}
|
2016-03-24 14:08:29 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @dataProvider providePCREErrors
|
|
|
|
*/
|
|
|
|
public function testPCREErrors( $ini, $args, $error ) {
|
|
|
|
// Not applicable
|
|
|
|
$this->assertTrue( true );
|
|
|
|
}
|
|
|
|
|
|
|
|
public static function providePCREErrors() {
|
2017-06-15 17:19:00 +00:00
|
|
|
return [
|
|
|
|
[ [], [], null ],
|
|
|
|
];
|
2016-03-24 14:08:29 +00:00
|
|
|
}
|
2014-07-10 19:21:58 +00:00
|
|
|
}
|