From e8b690de434e737fc9332bd663ff8f2bb54a937c Mon Sep 17 00:00:00 2001 From: Hidde Beydals Date: Mon, 3 Aug 2015 15:46:07 +0200 Subject: [PATCH] Update tests to get 100% coverage --- tests/Adapters/EventDispatcherTestLaravel4.php | 10 ++++++++++ tests/Adapters/EventDispatcherTestLaravel5.php | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/tests/Adapters/EventDispatcherTestLaravel4.php b/tests/Adapters/EventDispatcherTestLaravel4.php index 93074299..e86c8887 100644 --- a/tests/Adapters/EventDispatcherTestLaravel4.php +++ b/tests/Adapters/EventDispatcherTestLaravel4.php @@ -64,6 +64,16 @@ public function testItKnowsIfTheLaravelDispatcherHasListeners() * assert that it is the Symfony Dispatcher */ + public function testLegacyEventReceivesTheDispatcherInstance() + { + $dispatcher = null; + $this->dispatcher->addListener('test', function ($event) use (&$dispatcher) { + $dispatcher = $event->getDispatcher(); + }); + $this->dispatcher->dispatch('test'); + $this->assertSame($this->symfonyDispatcher, $dispatcher); + } + public function testEventReceivesTheDispatcherInstance() { $dispatcher = null; diff --git a/tests/Adapters/EventDispatcherTestLaravel5.php b/tests/Adapters/EventDispatcherTestLaravel5.php index 72e3ac86..6c9658f6 100644 --- a/tests/Adapters/EventDispatcherTestLaravel5.php +++ b/tests/Adapters/EventDispatcherTestLaravel5.php @@ -64,6 +64,16 @@ public function testItKnowsIfTheLaravelDispatcherHasListeners() * assert that it is the Symfony Dispatcher */ + public function testLegacyEventReceivesTheDispatcherInstance() + { + $dispatcher = null; + $this->dispatcher->addListener('test', function ($event) use (&$dispatcher) { + $dispatcher = $event->getDispatcher(); + }); + $this->dispatcher->dispatch('test'); + $this->assertSame($this->symfonyDispatcher, $dispatcher); + } + public function testEventReceivesTheDispatcherInstance() { $dispatcher = null;