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

MessageReporterAwareTest   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A testTrait() 0 10 1
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
}