1
0
mirror of https://github.com/guzzle/guzzle.git synced 2025-02-25 02:22:57 +01:00

Allow a single instance of a Response object to be set as the next mocked response

This commit is contained in:
Christer Edvartsen 2014-01-09 22:22:48 +01:00
parent 95fa195c5c
commit aef2879c45

View File

@ -188,6 +188,12 @@ abstract class GuzzleTestCase extends \PHPUnit_Framework_TestCase
$that->addMockedRequest($event['request']);
});
if ($paths instanceof Response) {
// A single response instance has been specified, create an array with that instance
// as the only element for the following loop to work as expected
$paths = array($paths);
}
foreach ((array) $paths as $path) {
$mock->addResponse($this->getMockResponse($path));
}