Completed
Push — master ( 975979...72a30b )
by mw
01:55
created

testCanConstructSpyMessageReporter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 9
rs 9.6666
cc 1
eloc 5
nc 1
nop 0
1
<?php
2
3
namespace Onoi\MessageReporter\Tests;
4
5
use Onoi\MessageReporter\MessageReporterFactory;
6
7
/**
8
 * @covers \Onoi\MessageReporter\MessageReporterFactory
9
 * @group onoi-message-reporter
10
 *
11
 * @license GNU GPL v2+
12
 * @since 1.0
13
 *
14
 * @author mwjames
15
 */
16
class CacheFactoryTest extends \PHPUnit_Framework_TestCase {
17
18
	public function testCanConstruct() {
19
20
		$this->assertInstanceOf(
21
			'\Onoi\MessageReporter\MessageReporterFactory',
22
			new MessageReporterFactory()
23
		);
24
25
		$this->assertInstanceOf(
26
			'\Onoi\MessageReporter\MessageReporterFactory',
27
			MessageReporterFactory::getInstance()
28
		);
29
	}
30
31
	public function testClear() {
32
33
		$instance = MessageReporterFactory::getInstance();
34
35
		$this->assertSame(
36
			$instance,
37
			MessageReporterFactory::getInstance()
38
		);
39
40
		$instance->clear();
41
42
		$this->assertNotSame(
43
			$instance,
44
			MessageReporterFactory::getInstance()
45
		);
46
	}
47
48
	public function testCanConstructNullMessageReporter() {
49
50
		$instance = new MessageReporterFactory();
51
52
		$this->assertInstanceOf(
53
			'\Onoi\MessageReporter\NullMessageReporter',
54
			$instance->newNullMessageReporter()
55
		);
56
	}
57
58
	public function testCanConstructObservableMessageReporter() {
59
60
		$instance = new MessageReporterFactory();
61
62
		$this->assertInstanceOf(
63
			'\Onoi\MessageReporter\ObservableMessageReporter',
64
			$instance->newObservableMessageReporter()
65
		);
66
	}
67
68
	public function testCanConstructSpyMessageReporter() {
69
70
		$instance = new MessageReporterFactory();
71
72
		$this->assertInstanceOf(
73
			'\Onoi\MessageReporter\SpyMessageReporter',
74
			$instance->newSpyMessageReporter()
75
		);
76
	}
77
78
}
79