Completed
Push — master ( 0591cb...33c12c )
by
unknown
07:17
created

CacheKeyProviderTest::testCanConstruct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 7
rs 10
c 1
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace SCI\Tests;
4
5
use SCI\CacheKeyProvider;
6
7
/**
8
 * @covers \SCI\CacheKeyProvider
9
 * @group semantic-cite
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
			'\SCI\CacheKeyProvider',
22
			new CacheKeyProvider()
23
		);
24
	}
25
26
	public function testGetKey() {
27
28
		$instance = new CacheKeyProvider();
29
		$instance->setCachePrefix( 'foo' );
30
31
		$this->assertContains(
32
			'foo',
33
			$instance->getCacheKeyForCitationReference( 'abc' )
34
		);
35
36
		$this->assertContains(
37
			':ref:',
38
			$instance->getCacheKeyForCitationReference( 123 )
39
		);
40
41
		$this->assertContains(
42
			'foo',
43
			$instance->getCacheKeyForReferenceList( 'def' )
44
		);
45
46
		$this->assertContains(
47
			':reflist:',
48
			$instance->getCacheKeyForReferenceList( 456 )
49
		);
50
	}
51
52
}
53