/**
  * @inheritDoc
  */
 protected function extractData($responseLine, Server $server)
 {
     list(, $dataLength) = explode(' ', $responseLine);
     $rawData = $server->readData($dataLength);
     try {
         return Yaml::parse($rawData);
     } catch (ParseException $exception) {
         throw Exception::wrap($exception);
     }
 }
Exemple #2
0
 /**
  * @expectedException \Beanie\Exception\SocketException
  * @expectedExceptionCode 123
  * @expectedExceptionMessage nope
  */
 public function testReadData_connectionDropped_throwsSocketException()
 {
     $this->_socketCreateSuccess();
     $this->_socketConnectSuccess();
     $this->_setSocketError(123, 'nope');
     $this->_getNativeFunctionMock()->expects($this->once())->method('socket_read')->willReturn(false);
     $server = new Server();
     $server->readData(321);
 }