From 5f1f0739f99b02e8636d2b1d8f4203a315b7a911 Mon Sep 17 00:00:00 2001 From: Ramesh Mhetre Date: Fri, 11 Aug 2017 09:49:19 +0530 Subject: [PATCH 1/2] Improved tests code quality Signed-off-by: Ramesh Mhetre --- tests/TestHelper.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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); } } From 65cd763967de3c7362dc81f6e000a27903e05a1c Mon Sep 17 00:00:00 2001 From: Ramesh Mhetre Date: Mon, 2 Jul 2018 16:24:05 +0200 Subject: [PATCH 2/2] Added phpunit for hhvm Signed-off-by: Ramesh Mhetre --- phpunit.hhvm.xml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 phpunit.hhvm.xml 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