diff --git a/phpunit.hhvm.xml b/phpunit.hhvm.xml new file mode 100644 index 0000000..3b722c1 --- /dev/null +++ b/phpunit.hhvm.xml @@ -0,0 +1,24 @@ + + + + + ./tests/ + + + + + ./src/ + + + \ No newline at end of file diff --git a/tests/TestHelper.php b/tests/TestHelper.php index 6bc4688..3e31837 100755 --- a/tests/TestHelper.php +++ b/tests/TestHelper.php @@ -3,13 +3,17 @@ namespace BackblazeB2\Tests; use BackblazeB2\Http\Client as HttpClient; +use GuzzleHttp\Handler\MockHandler; +use GuzzleHttp\HandlerStack; +use GuzzleHttp\Psr7\Response; + trait TestHelper { protected function buildGuzzleFromResponses(array $responses, $history = null) { - $mock = new \GuzzleHttp\Handler\MockHandler($responses); - $handler = new \GuzzleHttp\HandlerStack($mock); + $mock = new MockHandler($responses); + $handler = new HandlerStack($mock); if ($history) { $handler->push($history); @@ -22,6 +26,6 @@ protected function buildResponseFromStub($statusCode, array $headers = [], $resp { $response = file_get_contents(dirname(__FILE__) . '/responses/' . $responseFile); - return new \GuzzleHttp\Psr7\Response($statusCode, $headers, $response); + return new Response($statusCode, $headers, $response); } }