summaryrefslogtreecommitdiff
path: root/vendor/guzzle/guzzle/tests/Guzzle/Tests/Mock/ErrorResponseMock.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/guzzle/guzzle/tests/Guzzle/Tests/Mock/ErrorResponseMock.php')
-rw-r--r--vendor/guzzle/guzzle/tests/Guzzle/Tests/Mock/ErrorResponseMock.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/vendor/guzzle/guzzle/tests/Guzzle/Tests/Mock/ErrorResponseMock.php b/vendor/guzzle/guzzle/tests/Guzzle/Tests/Mock/ErrorResponseMock.php
new file mode 100644
index 0000000..aabb15f
--- /dev/null
+++ b/vendor/guzzle/guzzle/tests/Guzzle/Tests/Mock/ErrorResponseMock.php
@@ -0,0 +1,25 @@
+<?php
+
+namespace Guzzle\Tests\Mock;
+
+use Guzzle\Plugin\ErrorResponse\ErrorResponseExceptionInterface;
+use Guzzle\Service\Command\CommandInterface;
+use Guzzle\Http\Message\Response;
+
+class ErrorResponseMock extends \Exception implements ErrorResponseExceptionInterface
+{
+ public $command;
+ public $response;
+
+ public static function fromCommand(CommandInterface $command, Response $response)
+ {
+ return new self($command, $response);
+ }
+
+ public function __construct($command, $response)
+ {
+ $this->command = $command;
+ $this->response = $response;
+ $this->message = 'Error from ' . $response;
+ }
+}