diff --git a/tests/Guzzle/Tests/Service/Command/CommandTest.php b/tests/Guzzle/Tests/Service/Command/CommandTest.php index a34e335b..1af888a9 100644 --- a/tests/Guzzle/Tests/Service/Command/CommandTest.php +++ b/tests/Guzzle/Tests/Service/Command/CommandTest.php @@ -158,6 +158,24 @@ class CommandTest extends AbstractCommandTest ), $command->getResult()); } + /** + * @covers Guzzle\Service\Command\AbstractCommand::process + * @expectedException Guzzle\Service\Exception\JsonException + */ + public function testConvertsInvalidJsonResponsesToArray() + { + $client = $this->getClient(); + $client->getEventDispatcher()->addSubscriber(new MockPlugin(array( + new \Guzzle\Http\Message\Response(200, array( + 'Content-Type' => 'application/json' + ), '{ "key": "Hi!" }invalid' + ) + ))); + $command = new MockCommand(); + $command->setClient($client); + $command->execute(); + } + /** * @covers Guzzle\Service\Command\AbstractCommand::process */