EventDispatcherTest::testDispatchSubscriber()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 3
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 9.4285
1
<?php
2
3
namespace Symnedi\EventDispatcher\Tests;
4
5
use Exception;
6
use PHPUnit_Framework_TestCase;
7
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
8
9
10
final class EventDispatcherTest extends PHPUnit_Framework_TestCase
11
{
12
13
	/**
14
	 * @var EventDispatcherInterface
15
	 */
16
	private $eventDispatcher;
17
18
19
	protected function setUp()
20
	{
21
		$container = (new ContainerFactory)->create();
22
		$this->eventDispatcher = $container->getByType(EventDispatcherInterface::class);
23
	}
24
25
26
	public function testDispatchSubscriber()
27
	{
28
		$this->setExpectedException(Exception::class, 'Event was dispatched in subscriber.');
0 ignored issues
show
Deprecated Code introduced by
The method PHPUnit_Framework_TestCase::setExpectedException() has been deprecated with message: Method deprecated since Release 5.2.0

This method has been deprecated. The supplier of the class has supplied an explanatory message.

The explanatory message should give you some clue as to whether and when the method will be removed from the class and what other method or class to use instead.

Loading history...
29
		$this->eventDispatcher->dispatch('subscriber.event');
30
	}
31
32
}
33