public function testObservable() { $e = new NeevoException(); $observer = new DummyObserver(); $e->attachObserver($observer, $event = DummyObserver::EXCEPTION); $e->notifyObservers($event); $this->assertTrue($observer->isNotified($firedEvent)); $this->assertEquals($event, $firedEvent); $observer->reset(); $e->detachObserver($observer); $e->notifyObservers($event); $this->assertFalse($observer->isNotified()); }
/** * Detaches given observer. * @param ObserverInterface $observer */ public function detachObserver(ObserverInterface $observer) { $this->connection->detachObserver($observer); $this->observers->detach($observer); $e = new NeevoException(); $e->detachObserver($observer); }