Empty responses can be returned when requesting an unsupported section with the INFO command.
@@ -22,7 +22,12 @@ class ServerInfoV26x extends ServerInfo
*/
public function parseResponse($data)
{
+ if ($data === '') {
+ return array();
+ }
+
$info = array();
$current = null;
$infoLines = preg_split('/\r?\n/', $data);
@@ -291,6 +291,14 @@ BUFFER;
$this->assertSame($expected, $this->getCommand()->parseResponse($raw));
}
+ /**
+ * @group disconnected
+ */
+ public function testDoesNotEmitPhpNoticeOnEmptyResponse()
+ {
+ $this->assertSame(array(), $this->getCommand()->parseResponse(''));
/**
* @group connected