mirror of
https://github.com/predis/predis.git
synced 2026-08-25 12:09:43 +00:00
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:
@@ -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
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user