summaryrefslogtreecommitdiff
path: root/www/wiki/extensions/Scribunto/tests/phpunit/engines/LuaCommon/UstringLibraryPureLuaTest.php
blob: 9743e0d5501e244df235b5afb1492e4666bfbf09 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php

require_once __DIR__ . '/UstringLibraryTest.php';

// @codingStandardsIgnoreLine Squiz.Classes.ValidClassName.NotCamelCaps
class Scribunto_LuaUstringLibraryPureLuaTest extends Scribunto_LuaUstringLibraryTest {
	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 [
			[ [], [], null ],
		];
	}
}