Пример #1
0
 public function testCloseConnection()
 {
     $this->instance->attachObserver($o = new DummyObserver(), DummyObserver::DISCONNECT);
     $this->instance->__destruct();
     $this->assertTrue($this->instance->getDriver()->isClosed());
     $this->assertTrue($o->isNotified());
 }
Пример #2
0
 /**
  * Attaches an observer for debugging.
  * @param ObserverInterface $observer
  * @param int $event Event to attach the observer to.
  */
 public function attachObserver(ObserverInterface $observer, $event)
 {
     $this->observers->attach($observer, $event);
     $this->connection->attachObserver($observer, $event);
     $e = new NeevoException();
     $e->attachObserver($observer, $event);
 }