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;