NullResponseParserTest::testCommonMethods()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 38
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 38
rs 8.8571
c 1
b 0
f 0
cc 1
eloc 20
nc 1
nop 0
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