dataProviderFunctionTest()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11

Duplication

Lines 0
Ratio 0 %

Importance

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