Fix E_NOTICE emitted on empty response to INFO [section].

Empty responses can be returned when requesting an unsupported section
with the INFO command.
This commit is contained in:
Daniele Alessandri
2014-10-25 17:45:00 +02:00
parent 24e19a9b76
commit 5e24d85c8a
2 changed files with 13 additions and 0 deletions
+5
View File
@@ -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
*/