/** * Tests attempting to get a new event on the active connection when no * data is available. * * @return void * @depends testSetConnectionWithNewConnection * @depends testDoConnectWithoutPassword */ public function testGetEventWithNoData() { $this->acceptAllCommands(); $connection = $this->getMockConnection(); $this->driver->setConnection($connection); $this->driver->doConnect(); $result = $this->driver->getEvent(); $this->driver->doQuit(); $this->assertNull($result); }
/** * Tests that an attempt to send a command without an active connection * results in an exception. * * @return void */ public function testSendWithoutConnectionThrowsException() { try { $this->driver->doQuit(); $this->fail('Expected exception not thrown'); } catch (Phergie_Driver_Exception $e) { if ($e->getCode() != Phergie_Driver_Exception::ERR_NO_ACTIVE_CONNECTION) { $this->fail('Unexpected exception code: ' . $e->getCode()); } } }