NullResponseParserTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 54
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 54
rs 10
c 1
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCanConstruct() 0 11 1
B testCommonMethods() 0 38 1
1
<?php
2
3
namespace Onoi\Remi\Tests;
4
5
use Onoi\Remi\NullResponseParser;
6
7
/**
8
 * @covers \Onoi\Remi\NullResponseParser
9
 * @group onoi-remi
10
 *
11
 * @license GNU GPL v2+
12
 * @since   0.1
13
 *
14
 * @author mwjames
15
 */
16
class NullResponseParserTest extends \PHPUnit_Framework_TestCase {
17
18
	public function testCanConstruct() {
19
20
		$filteredRecord = $this->getMockBuilder( '\Onoi\Remi\FilteredRecord' )
21
			->disableOriginalConstructor()
22
			->getMock();
23
24
		$this->assertInstanceOf(
25
			'\Onoi\Remi\NullResponseParser',
26
			new NullResponseParser( $filteredRecord )
27
		);
28
	}
29
30
	public function testCommonMethods() {
31
32
		$filteredRecord = $this->getMockBuilder( '\Onoi\Remi\FilteredRecord' )
33
			->disableOriginalConstructor()
34
			->getMock();
35
36
		$instance = new NullResponseParser( $filteredRecord );
37
38
		$this->assertEquals(
39
			$filteredRecord,
40
			$instance->getFilteredRecord()
41
		);
42
43
		$this->assertFalse(
44
			$instance->usesCache()
45
		);
46
47
		$this->assertEmpty(
48
			$instance->getMessages()
49
		);
50
51
		$this->assertNull(
52
			$instance->doFilterResponseById( 42 )
53
		);
54
55
		$this->assertNull(
56
			$instance->doFilterResponseFor( 42 )
57
		);
58
59
		$this->assertEmpty(
60
			$instance->getRawResponse( 42 )
61
		);
62
63
		$this->assertEmpty(
64
			$instance->getRawResponseById( 42 )
65
		);
66
67
	}
68
69
}
70