JSONScriptTestCaseRunnerSemanticImageCaptionTest   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 53
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 2
dl 0
loc 53
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A setUp() 0 6 1
A runTestAssertionForType() 0 3 1
A getTestCaseLocation() 0 3 1
A getRequiredJsonTestCaseMinVersion() 0 3 1
A getPermittedSettings() 0 11 1
1
<?php
2
3
namespace SMW\ImageCaption\Tests\Integration\JSONScript;
4
5
use SMW\Tests\JSONScriptServicesTestCaseRunner;
6
use SMW\ImageCaption\Hooks;
7
8
/**
9
 * @see https://github.com/SemanticMediaWiki/SemanticMediaWiki/blob/master/tests/phpunit/Integration/JSONScript/docs/extension.md
10
 *
11
 * @group semantic-image-caption
12
 * @group medium
13
 *
14
 * @license GNU GPL v2+
15
 * @since 1.0
16
 *
17
 * @author mwjames
18
 */
19
class JSONScriptTestCaseRunnerSemanticImageCaptionTest extends JSONScriptServicesTestCaseRunner {
20
21
	/**
22
	 * @var Hooks
23
	 */
24
	private $hooks;
25
26
	protected function setUp() : void {
27
		parent::setUp();
28
29
		$this->hooks = new Hooks();
30
		$this->hooks->register();
31
	}
32
33
	/**
34
	 * @see JSONScriptServicesTestCaseRunner::runTestAssertionForType
35
	 */
36
	protected function runTestAssertionForType( string $type ) : bool {
37
		return $type === 'parser';
38
	}
39
40
	/**
41
	 * @see JSONScriptTestCaseRunner::getTestCaseLocation
42
	 * @return string
43
	 */
44
	protected function getTestCaseLocation() {
45
		return __DIR__ . '/TestCases';
46
	}
47
48
	/**
49
	 * @see JSONScriptTestCaseRunner::getRequiredJsonTestCaseMinVersion
50
	 * @return string
51
	 */
52
	protected function getRequiredJsonTestCaseMinVersion() {
53
		return '1';
54
	}
55
56
	/**
57
	 * @see JSONScriptTestCaseRunner::getPermittedSettings
58
	 */
59
	protected function getPermittedSettings() {
60
		$settings = parent::getPermittedSettings();
61
62
		return array_merge( $settings, [
63
			'smwgNamespacesWithSemanticLinks',
64
			'smwgPageSpecialProperties',
65
			'wgLanguageCode',
66
			'wgContLang',
67
			'wgLang'
68
		] );
69
	}
70
71
}
72