From 28c0c8fb30ae492791782febbe3200be653ac8c3 Mon Sep 17 00:00:00 2001 From: Kristopher Wilson Date: Tue, 13 Sep 2016 08:59:13 -0400 Subject: [PATCH] Support PHP 5.6 --- .travis.yml | 1 + composer.json | 2 +- composer.lock | 6 +++--- specs/Endpoint/abstract-wp-endpoint.spec.php | 18 ++++++++---------- 4 files changed, 13 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9f60fc1..a3fa48c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,7 @@ language: php php: + - 5.6 - 7 before_script: diff --git a/composer.json b/composer.json index f35dc19..7499943 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ } }, "require": { - "php": ">= 7.0, <= 8.0", + "php": ">= 5.6, <= 8.0", "psr/http-message": "^1.0" }, "require-dev": { diff --git a/composer.lock b/composer.lock index 2d33d55..f5a79a4 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "dbedbe75432865bb6906b0da32a7c330", - "content-hash": "7d153173ee1771e7a620a1eba4f42a03", + "hash": "97cd566d3eea8745a0634998968f4a11", + "content-hash": "06e6daa87a8a0ea3bc19e0aa756bffa4", "packages": [ { "name": "psr/http-message", @@ -1257,7 +1257,7 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": ">= 7.0, <= 8.0" + "php": ">= 5.6, <= 8.0" }, "platform-dev": [] } diff --git a/specs/Endpoint/abstract-wp-endpoint.spec.php b/specs/Endpoint/abstract-wp-endpoint.spec.php index 8766fa4..7f77987 100644 --- a/specs/Endpoint/abstract-wp-endpoint.spec.php +++ b/specs/Endpoint/abstract-wp-endpoint.spec.php @@ -14,11 +14,7 @@ $client->send($request)->willReturn($response)->shouldBeCalled(); - $endpoint = new class($client->reveal()) extends AbstractWpEndpoint { - public function getEndpoint() { - return '/foo'; - } - }; + $endpoint = new FakeEndpoint($client->reveal()); $data = $endpoint->get(55); expect($data)->to->equal(['foo' => 'bar']); @@ -31,11 +27,7 @@ public function getEndpoint() { $response = new \GuzzleHttp\Psr7\Response(200, ['Content-Type' => 'application/json'], '{"foo": "bar"}'); $client->send(\Prophecy\Argument::type(Request::class))->willReturn($response)->shouldBeCalled(); - $endpoint = new class($client->reveal()) extends AbstractWpEndpoint { - public function getEndpoint() { - return '/foo'; - } - }; + $endpoint = new FakeEndpoint($client->reveal()); $data = $endpoint->save(['foo' => 'bar']); expect($data)->to->equal(['foo' => 'bar']); @@ -46,3 +38,9 @@ public function getEndpoint() { $this->getProphet()->checkPredictions(); }); }); + +class FakeEndpoint extends AbstractWpEndpoint { + public function getEndpoint() { + return '/foo'; + } +}