NullRequestTest::testNull()   B
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 39
Code Lines 23

Duplication

Lines 0
Ratio 0 %

Importance

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