CacheKeyProviderTest   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 41
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 41
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A testCanConstruct() 0 7 1
A testGetSiteCacheKey() 0 9 1
A testGetPageLanguageCacheBlobKey() 0 9 1
A testGetPageCacheKey() 0 9 1
1
<?php
2
3
namespace SIL\Tests;
4
5
use SIL\CacheKeyProvider;
6
7
/**
8
 * @covers \SIL\CacheKeyProvider
9
 * @group semantic-interlanguage-links
10
 *
11
 * @license GNU GPL v2+
12
 * @since 1.0
13
 *
14
 * @author mwjames
15
 */
16
class CacheKeyProviderTest extends \PHPUnit_Framework_TestCase {
17
18
	public function testCanConstruct() {
19
20
		$this->assertInstanceOf(
21
			'\SIL\CacheKeyProvider',
22
			new CacheKeyProvider( 'foo' )
23
		);
24
	}
25
26
	public function testGetSiteCacheKey() {
27
28
		$instance = new CacheKeyProvider( 'foo' );
29
30
		$this->assertSame(
31
			$instance->getSiteCacheKey( 'foo' ),
32
			$instance->getSiteCacheKey( 'foo' )
33
		);
34
	}
35
36
	public function testGetPageLanguageCacheBlobKey() {
37
38
		$instance = new CacheKeyProvider( 'foo' );
39
40
		$this->assertSame(
41
			$instance->getPageLanguageCacheBlobKey( 'foo' ),
42
			$instance->getPageLanguageCacheBlobKey( 'foo' )
43
		);
44
	}
45
46
	public function testGetPageCacheKey() {
47
48
		$instance = new CacheKeyProvider( 'foo'  );
49
50
		$this->assertSame(
51
			$instance->getPageCacheKey( 'foo', true ),
52
			$instance->getPageCacheKey( 'foo', true )
53
		);
54
	}
55
56
}
57