public function testPingFail() { $this->setExpectedException('Quahog\\Exception\\ConnectionException'); $this->socket->expects($this->any())->method('read')->will($this->returnValue(null)); $result = $this->quahog->ping(); $this->assertTrue($result); }