1 | <?php |
||
14 | final class EventDispatcherExtensionTest extends PHPUnit_Framework_TestCase |
||
15 | { |
||
16 | |||
17 | public function testGetEventDispatcher() |
||
18 | { |
||
19 | $extension = $this->getExtension(); |
||
20 | $extension->loadConfiguration(); |
||
21 | |||
22 | $containerBuilder = $extension->getContainerBuilder(); |
||
23 | |||
24 | // Emulates life cycle from Nette\DI\Compiler. |
||
25 | // @link https://github.com/nette/di/blob/9b0f8150f823ca22813ba9871156dabb20a911fa/src/DI/Compiler.php#L202-L207 |
||
26 | $containerBuilder->prepareClassList(); |
||
27 | |||
28 | $eventDispatcherDefinition = $containerBuilder->getDefinition( |
||
29 | $containerBuilder->getByType(EventDispatcherInterface::class) |
||
30 | ); |
||
31 | $this->assertSame(EventDispatcher::class, $eventDispatcherDefinition->getClass()); |
||
32 | } |
||
33 | |||
34 | |||
35 | public function testLoadSubscribers() |
||
57 | |||
58 | |||
59 | /** |
||
60 | * @return EventDispatcherExtension |
||
61 | */ |
||
62 | private function getExtension() |
||
68 | |||
69 | } |
||
70 |