NullRequestTest   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 58
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testCanConstruct() 0 14 1
B testNull() 0 39 1
1
<?php
2
3
namespace Onoi\HttpRequest\Tests;
4
5
use Onoi\HttpRequest\NullRequest;
6
7
/**
8
 * @covers \Onoi\HttpRequest\NullRequest
9
 * @group onoi-http-request
10
 *
11
 * @license GNU GPL v2+
12
 * @since 1.0
13
 *
14
 * @author mwjames
15
 */
16
class NullRequestTest extends \PHPUnit_Framework_TestCase {
17
18
	public function testCanConstruct() {
19
20
		$instance = new NullRequest();
21
22
		$this->assertInstanceOf(
23
			'\Onoi\HttpRequest\NullRequest',
24
			$instance
25
		);
26
27
		$this->assertInstanceOf(
28
			'\Onoi\HttpRequest\HttpRequest',
29
			$instance
30
		);
31
	}
32
33
	public function testNull() {
34
35
		$instance = new NullRequest();
36
37
		$this->assertInternalType(
38
			'boolean',
39
			$instance->ping()
40
		);
41
42
		$this->assertInternalType(
43
			'null',
44
			$instance->setOption( 'foo', 42 )
45
		);
46
47
		$this->assertInternalType(
48
			'null',
49
			$instance->getOption( 'foo' )
50
		);
51
52
		$this->assertInternalType(
53
			'null',
54
			$instance->getLastTransferInfo()
55
		);
56
57
		$this->assertInternalType(
58
			'string',
59
			$instance->getLastError()
60
		);
61
62
		$this->assertInternalType(
63
			'integer',
64
			$instance->getLastErrorCode()
65
		);
66
67
		$this->assertInternalType(
68
			'null',
69
			$instance->execute()
70
		);
71
	}
72
73
}
74