2014-07-10 19:21:58 +00:00
|
|
|
<?php
|
|
|
|
|
2016-05-17 14:52:05 +00:00
|
|
|
require_once __DIR__ . '/UstringLibraryTest.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 {
|
2014-11-12 11:21:38 +00:00
|
|
|
protected function setUp() {
|
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
|
|
|
}
|