ConfigurationIntegrityTest   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testValidityOfCacheTypeSetting() 0 10 2
A assertCacheType() 0 3 1
1
<?php
2
3
namespace SG\Tests;
4
5
use SG\Cache\GlossaryCache;
6
7
/**
8
 * @ingroup Test
9
 *
10
 * @group SG
11
 * @group SGExtension
12
 *
13
 * @license GNU GPL v2+
14
 * @since 1.0
15
 *
16
 * @author mwjames
17
 */
18
class ConfigurationIntegrityTest extends \PHPUnit_Framework_TestCase {
19
20
	public function testValidityOfCacheTypeSetting() {
21
22
		$instance = new GlossaryCache();
23
24
		if ( isset( $GLOBAL['wgexLingoCacheType'] ) ) {
0 ignored issues
show
Bug introduced by
The variable $GLOBAL seems to never exist, and therefore isset should always return false. Did you maybe rename this variable?

This check looks for calls to isset(...) or empty() on variables that are yet undefined. These calls will always produce the same result and can be removed.

This is most likely caused by the renaming of a variable or the removal of a function/method parameter.

Loading history...
25
			$this->assertCacheType( $GLOBAL['wgexLingoCacheType'] );
26
		}
27
28
		$this->assertCacheType( $instance->getCacheType() );
29
	}
30
31
	protected function assertCacheType( $cacheType ) {
32
		$this->assertTrue( array_key_exists( $cacheType, $GLOBALS['wgObjectCaches'] ) );
33
	}
34
35
}
36