Completed
Push — master ( 72a30b...cf8417 )
by mw
01:00
created

FooMessageReporterAware::getMesssageReporter()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Onoi\MessageReporter\Tests;
4
5
use Onoi\MessageReporter\MessageReporterAwareTrait;
6
use Onoi\MessageReporter\MessageReporterAware;
7
use Onoi\MessageReporter\MessageReporter;
8
use Onoi\MessageReporter\NullMessageReporter;
9
10
/**
11
 * @group onoi-message-reporter
12
 *
13
 * @license GNU GPL v2+
14
 * @since 1.3
15
 *
16
 * @author mwjames
17
 */
18
class MessageReporterAwareTest extends \PHPUnit_Framework_TestCase {
19
20
	public function testTrait() {
21
22
		$instance = new FooMessageReporterAware();
23
		$instance->setMessageReporter( new NullMessageReporter() );
24
25
		$this->assertInstanceOf(
26
			NullMessageReporter::class,
27
			$instance->getMesssageReporter()
28
		);
29
	}
30
31
}
32
33
class FooMessageReporterAware implements MessageReporterAware {
34
35
	use MessageReporterAwareTrait;
36
37
	public function getMesssageReporter() {
38
		return $this->messageReporter;
39
	}
40
41
}