ConfigurationIntegrityTest::assertCacheType()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
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