ScribuntoLuaLibraryPropertyTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 36
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 36
rs 10
wmc 2
lcom 0
cbo 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getTestModules() 0 5 1
A testGetPropertyType() 0 13 1
1
<?php
2
3
namespace SMW\Scribunto\Tests;
4
5
/**
6
 * @covers \SMW\Scribunto\ScribuntoLuaLibrary
7
 * @group semantic-scribunto
8
 *
9
 * @license GNU GPL v2+
10
 * @since 1.0
11
 *
12
 * @author mwjames
13
 */
14
class ScribuntoLuaLibraryPropertyTest extends ScribuntoLuaEngineTestBase {
15
16
	/**
17
	 * Lua test module
18
	 * @var string
19
	 */
20
	protected static $moduleName = 'SMW\Scribunto\Tests\ScribuntoLuaLibraryPropertyTest';
21
22
	/**
23
	 * ScribuntoLuaEngineTestBase::getTestModules
24
	 */
25
	public function getTestModules() {
26
		return parent::getTestModules() + [
27
			'SMW\Scribunto\Tests\ScribuntoLuaLibraryPropertyTest' => __DIR__ . '/' . 'mw.smw.property.tests.lua',
28
		];
29
	}
30
31
	/**
32
	 * Tests method getPropertyType
33
	 *
34
	 * @return void
35
	 */
36
	public function testGetPropertyType() {
37
		$this->assertEmpty(
38
			$this->getScribuntoLuaLibrary()->getPropertyType( '' )[0]
39
		);
40
		$this->assertEquals(
41
			'_dat',
42
			$this->getScribuntoLuaLibrary()->getPropertyType( 'Modification date' )[0]
43
		);
44
		$this->assertEquals(
45
			'_wpg',
46
			$this->getScribuntoLuaLibrary()->getPropertyType( 'Foo' )[0]
47
		);
48
	}
49
}
50