Completed
Push — master ( 498457...3132df )
by mw
02:32
created

dataProviderFunctionTest()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 7
nc 1
nop 0
dl 0
loc 10
rs 9.4285
c 1
b 0
f 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() + array(
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
	 * @used \SMW\Scribunto\Tests\ScribuntoLuaLibraryTest::dataProviderFunctionTest
45
	 *
46
	 * @return void
47
	 */
48
	public function testMethodsExist( $method ) {
49
		$this->assertTrue(
50
			method_exists( $this->getScribuntoLuaLibrary(), $method ),
51
			'Class \SMW\Scribunto\ScribuntoLuaLibrary has method \'' . $method . '()\' missing!'
52
		);
53
	}
54
55
56
	/**
57
	 * Data provider for {@see testFunctions}
58
	 *
59
	 * @see testFunctions
60
	 *
61
	 * @return array
62
	 */
63
	public function dataProviderFunctionTest() {
64
65
		return [
66
			[ 'getPropertyType' ],
67
			[ 'getQueryResult' ],
68
			[ 'info' ],
69
			[ 'set' ],
70
			[ 'subobject' ]
71
		];
72
	}
73
74
}