Completed
Branch master (ecb46d)
by Tobias
01:39
created

LuaLibraryTest::getTestModules()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
3
namespace BootstrapComponents\Tests\Unit;
4
5
/**
6
 * @covers \BootstrapComponents\LuaLibrary
7
 *
8
 * @license GNU GPL v2+
9
 * @since   1.1
10
 *
11
 * @author  Tobias Oetterer
12
 */
13
class LuaLibraryTest extends LuaLibraryTestBase {
14
15
	/**
16
	 * Lua test module
17
	 *
18
	 * @var string
19
	 */
20
	protected static $moduleName = self::class;
21
22
	/**
23
	 * LuaLibraryTestTest::getTestModules
24
	 */
25
	public function getTestModules() {
26
		return parent::getTestModules() + [
27
				self::$moduleName => __DIR__ . '/' . 'mw.bootstrap.tests.lua',
28
			];
29
	}
30
31
32
	public function testCanConstruct() {
33
		$this->assertInstanceOf(
34
			'BootstrapComponents\\LuaLibrary',
35
			$this->getLuaLibrary()
36
		);
37
	}
38
39
	/**
40
	 * Test, if all the necessary methods exists. Uses data provider {@see dataProviderFunctionTest}.
41
	 *
42
	 * @param string $method name of method to check
43
	 *
44
	 * @dataProvider dataProviderFunctionTest
45
	 */
46
	public function testMethodsExist( $method ) {
47
		$this->assertTrue(
48
			method_exists( $this->getLuaLibrary(), $method ),
49
			'Class BootstrapComponents\\LuaLibrary has method \'' . $method . '()\' missing!'
50
		);
51
	}
52
53
	/**
54
	 * Data provider for {@see testMethodsExist}
55
	 *
56
	 * @see testMethodsExist
57
	 *
58
	 * @return array
59
	 */
60
	public function dataProviderFunctionTest() {
61
62
		return [
63
			[ 'parse' ],
64
			[ 'getSkin' ],
65
		];
66
	}
67
}