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:
parent
95fa195c5c
commit
aef2879c45
@ -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));
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user