コード例 #1
0
ファイル: ConnectionTest.php プロジェクト: smasty/neevo
 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
ファイル: Manager.php プロジェクト: smasty/neevo
 /**
  * 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);
 }