diff --git a/src/EventManager.php b/src/EventManager.php index 3f4c58f..de51b1e 100644 --- a/src/EventManager.php +++ b/src/EventManager.php @@ -462,10 +462,6 @@ protected function triggerListeners($event, EventInterface $e, $callback = null) foreach ($listeners as $listener) { $listenerCallback = $listener->getCallback(); - if (!$listenerCallback) { - $this->detach($listener); - continue; - } // Trigger the listener's callback, and push its result onto the // response collection diff --git a/test/EventManagerTest.php b/test/EventManagerTest.php index 73af37d..380dc86 100644 --- a/test/EventManagerTest.php +++ b/test/EventManagerTest.php @@ -546,22 +546,6 @@ public function testTriggerCanTakeAnOptionalCallbackArgumentToEmulateTriggerUnti $this->assertTrue($responses->stopped()); } - public function testWeakRefsAreHonoredWhenTriggering() - { - if (!class_exists('WeakRef', false)) { - $this->markTestSkipped('Requires pecl/weakref'); - } - - $functor = new TestAsset\Functor; - $this->events->attach('test', $functor); - - unset($functor); - - $result = $this->events->trigger('test', $this, array()); - $message = $result->last(); - $this->assertNull($message); - } - public function testDuplicateIdentifiersAreNotRegistered() { $events = new EventManager(array(__CLASS__, get_class($this)));