Skip to content

Commit 4bb269f

Browse files
Merge pull request #2 from mrkrstphr/php56
Support PHP 5.6
2 parents 4b747e8 + 28c0c8f commit 4bb269f

File tree

4 files changed

+13
-14
lines changed

4 files changed

+13
-14
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
language: php
22

33
php:
4+
- 5.6
45
- 7
56

67
before_script:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
}
77
},
88
"require": {
9-
"php": ">= 7.0, <= 8.0",
9+
"php": ">= 5.6, <= 8.0",
1010
"psr/http-message": "^1.0"
1111
},
1212
"require-dev": {

composer.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specs/Endpoint/abstract-wp-endpoint.spec.php

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,7 @@
1414

1515
$client->send($request)->willReturn($response)->shouldBeCalled();
1616

17-
$endpoint = new class($client->reveal()) extends AbstractWpEndpoint {
18-
public function getEndpoint() {
19-
return '/foo';
20-
}
21-
};
17+
$endpoint = new FakeEndpoint($client->reveal());
2218

2319
$data = $endpoint->get(55);
2420
expect($data)->to->equal(['foo' => 'bar']);
@@ -31,11 +27,7 @@ public function getEndpoint() {
3127
$response = new \GuzzleHttp\Psr7\Response(200, ['Content-Type' => 'application/json'], '{"foo": "bar"}');
3228
$client->send(\Prophecy\Argument::type(Request::class))->willReturn($response)->shouldBeCalled();
3329

34-
$endpoint = new class($client->reveal()) extends AbstractWpEndpoint {
35-
public function getEndpoint() {
36-
return '/foo';
37-
}
38-
};
30+
$endpoint = new FakeEndpoint($client->reveal());
3931

4032
$data = $endpoint->save(['foo' => 'bar']);
4133
expect($data)->to->equal(['foo' => 'bar']);
@@ -46,3 +38,9 @@ public function getEndpoint() {
4638
$this->getProphet()->checkPredictions();
4739
});
4840
});
41+
42+
class FakeEndpoint extends AbstractWpEndpoint {
43+
public function getEndpoint() {
44+
return '/foo';
45+
}
46+
}

0 commit comments

Comments
 (0)