Skip to content

Commit

Permalink
Support PHP 5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkrstphr committed Sep 13, 2016
1 parent 4b747e8 commit 28c0c8f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: php

php:
- 5.6
- 7

before_script:
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}
},
"require": {
"php": ">= 7.0, <= 8.0",
"php": ">= 5.6, <= 8.0",
"psr/http-message": "^1.0"
},
"require-dev": {
Expand Down
6 changes: 3 additions & 3 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 8 additions & 10 deletions specs/Endpoint/abstract-wp-endpoint.spec.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand All @@ -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']);
Expand All @@ -46,3 +38,9 @@ public function getEndpoint() {
$this->getProphet()->checkPredictions();
});
});

class FakeEndpoint extends AbstractWpEndpoint {
public function getEndpoint() {
return '/foo';
}
}

0 comments on commit 28c0c8f

Please sign in to comment.