-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathLuaLibraryTest.php
More file actions
71 lines (61 loc) · 1.39 KB
/
LuaLibraryTest.php
File metadata and controls
71 lines (61 loc) · 1.39 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
<?php
namespace MediaWiki\Extension\BootstrapComponents\Tests\Unit;
use MediaWiki\Extension\BootstrapComponents\LuaLibrary;
/**
* @covers \MediaWiki\Extension\BootstrapComponents\LuaLibrary
*
* @group Database
*
* @license GNU GPL v2+
* @since 1.1
*
* @author Tobias Oetterer
*/
class LuaLibraryTest extends LuaLibraryTestBase {
/**
* Lua test module
*
* @var string
*/
protected static $moduleName = self::class;
/**
* LuaLibraryTestTest::getTestModules
*/
public function getTestModules() {
return parent::getTestModules() + [
self::$moduleName => __DIR__ . '/' . 'mw.bootstrap.tests.lua',
];
}
public function testCanConstruct() {
$this->assertInstanceOf(
LuaLibrary::class,
$this->getLuaLibrary()
);
}
/**
* Test, if all the necessary methods exists. Uses data provider {@see dataProviderFunctionTest}.
*
* @param string $method name of method to check
*
* @dataProvider dataProviderFunctionTest
*/
public function testMethodsExist( $method ) {
$this->assertTrue(
method_exists( $this->getLuaLibrary(), $method ),
'Class MediaWiki\\Extension\\BootstrapComponents\\LuaLibrary has method \'' . $method . '()\' missing!'
);
}
/**
* Data provider for {@see testMethodsExist}
*
* @see testMethodsExist
*
* @return array
*/
public function dataProviderFunctionTest() {
return [
[ 'parse' ],
[ 'getSkin' ],
];
}
}