| 1 | <?php |
||
| 11 | class EventDispatcherSpec extends ObjectBehavior |
||
| 12 | { |
||
| 13 | function it_can_dispatch_event(StubEventListener $eventListener, StubEvent $event) |
||
| 14 | { |
||
| 15 | $event->isPropagationStopped()->willReturn(false); |
||
| 16 | $event = $event->getWrappedObject(); |
||
| 17 | $this->addListener(get_class($event), [$eventListener, 'handle']); |
||
| 18 | $this->dispatch($event); |
||
| 19 | $eventListener->handle($event)->shouldHaveBeenCalled(); |
||
| 20 | } |
||
| 21 | |||
| 22 | function it_is_initializable() |
||
| 23 | { |
||
| 24 | $this->shouldHaveType(EventDispatcher::class); |
||
| 25 | $this->shouldImplement(EventDispatcherContract::class); |
||
| 26 | } |
||
| 27 | } |
||
| 28 |