Skip to content

Commit 9755994

Browse files
committed
Allow PHP 8 and fix a test
1 parent 5de6909 commit 9755994

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

composer.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "tobyz/json-api-server",
33
"description": "A fully automated JSON:API server implementation in PHP.",
44
"require": {
5-
"php": "^7.2",
5+
"php": "^7.2|^8.0",
66
"doctrine/inflector": "^1.3",
77
"json-api-php/json-api": "^2.2",
88
"nyholm/psr7": "^1.3",
@@ -31,9 +31,10 @@
3131
}
3232
},
3333
"require-dev": {
34-
"dms/phpunit-arraysubset-asserts": "^0.1.0",
34+
"dms/phpunit-arraysubset-asserts": "^0.2",
3535
"helmich/phpunit-json-assert": "^3.0",
36-
"phpunit/phpunit": "^8.0"
36+
"phpspec/prophecy-phpunit": "^2.0",
37+
"phpunit/phpunit": "^9.0"
3738
},
3839
"scripts": {
3940
"test": "phpunit"

src/Endpoint/Index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ private function filter($query, Context $context)
249249
continue;
250250
}
251251

252-
if (isset($filters[$name]) && evaluate($filters[$name]->getVisible(), [$this->context])) {
252+
if (isset($filters[$name]) && evaluate($filters[$name]->getVisible(), [$context])) {
253253
$filters[$name]->getCallback()($query, $value, $context);
254254
continue;
255255
}

tests/feature/CreateTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
namespace Tobyz\Tests\JsonApiServer\feature;
1313

14+
use Prophecy\PhpUnit\ProphecyTrait;
1415
use Tobyz\JsonApiServer\Adapter\AdapterInterface;
1516
use Tobyz\JsonApiServer\Exception\ForbiddenException;
1617
use Tobyz\JsonApiServer\JsonApi;
@@ -21,6 +22,8 @@
2122

2223
class CreateTest extends AbstractTestCase
2324
{
25+
use ProphecyTrait;
26+
2427
/**
2528
* @var JsonApi
2629
*/

tests/feature/DeleteTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
namespace Tobyz\Tests\JsonApiServer\feature;
1313

14-
use Psr\Http\Message\ServerRequestInterface;
14+
use Prophecy\PhpUnit\ProphecyTrait;
1515
use Tobyz\JsonApiServer\Adapter\AdapterInterface;
1616
use Tobyz\JsonApiServer\Exception\ForbiddenException;
1717
use Tobyz\JsonApiServer\JsonApi;
@@ -22,6 +22,8 @@
2222

2323
class DeleteTest extends AbstractTestCase
2424
{
25+
use ProphecyTrait;
26+
2527
/**
2628
* @var JsonApi
2729
*/

0 commit comments

Comments
 (0)