NamespacedKeyBuilderCacheTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 25
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testGetKey() 0 5 1
A namespaceAndKeyProvider() 0 12 1
1
<?php
2
3
namespace SimpleCache\Tests\Phpunit\KeyBuilder;
4
5
use SimpleCache\KeyBuilder\NamespacedKeyBuilder;
6
7
/**
8
 * @covers SimpleCache\KeyBuilder\NamespacedKeyBuilder
9
 *
10
 * @licence GNU GPL v2+
11
 * @author Jeroen De Dauw < [email protected] >
12
 */
13
class NamespacedKeyBuilderCacheTest extends \PHPUnit_Framework_TestCase {
14
15
	/**
16
	 * @dataProvider namespaceAndKeyProvider
17
	 */
18
	public function testGetKey( $namespace, $key ) {
19
		$keyBuilder = new NamespacedKeyBuilder( $namespace );
20
21
		$this->assertInternalType( 'string', $keyBuilder->buildKey( $key ) );
22
	}
23
24
	public function namespaceAndKeyProvider() {
25
		$argLists = array();
26
27
		$argLists[] = array( '', '' );
28
		$argLists[] = array( '', 'foo' );
29
		$argLists[] = array( 'foo', 'foo' );
30
		$argLists[] = array( 'foo', '' );
31
		$argLists[] = array( 'foo', 'bar' );
32
		$argLists[] = array( 'foo bar', 'bar baz' );
33
34
		return $argLists;
35
	}
36
37
}
38