Laravel-json-api: [BUG] Test failing on Laravel 6.1

Created on 11 Oct 2019  路  4Comments  路  Source: cloudcreativity/laravel-json-api

So, if you upgrade to Laravel 6.2 there is a problem with the testing.

Downgrading back solves the problem. I leave a bit of a stack trace and test test code so u can try reproduce :)

Test code:

$group = factory(Group::class)->create();

        $this->doRead($group)
            ->assertFetchedOne([
                'type' => $this->resourceType,
                'id' => "{$group->id}",
                'attributes' => [
                    'text' => $group->text,
                    'landing_pages' => $group->landing_pages,
                    'site' => $group->site_id,
                    'custom' => $group->custom,
                    'created_at' => $group->created_at->toAtomString(),
                    'updated_at' => $group->updated_at->toAtomString(),
                ],
            ]);

Stack trace:

ErrorException: Declaration of CloudCreativity\JsonApi\Testing\Concerns\HasHttpAssertions::assertNoContent(): CloudCreativity\JsonApi\Testing\Concerns\HasHttpAssertions should be compatible with Illuminate\Foundation\Testing\TestResponse::assertNoContent($status = 204)

/Users/umbert/Repos/keywords.services/vendor/cloudcreativity/laravel-json-api/src/Testing/TestResponse.php:32
/Users/umbert/Repos/keywords.services/vendor/cloudcreativity/laravel-json-api/src/Testing/MakesJsonApiRequests.php:178
/Users/umbert/Repos/keywords.services/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:443
/Users/umbert/Repos/keywords.services/vendor/laravel/framework/src/Illuminate/Foundation/Testing/Concerns/MakesHttpRequests.php:406
/Users/umbert/Repos/keywords.services/vendor/cloudcreativity/laravel-json-api/src/Testing/MakesJsonApiRequests.php:103
/Users/umbert/Repos/keywords.services/vendor/cloudcreativity/laravel-json-api/src/Testing/MakesJsonApiRequests.php:152
/Users/umbert/Repos/keywords.services/vendor/cloudcreativity/laravel-json-api/src/Testing/MakesJsonApiRequests.php:307

Most helpful comment

Just released this, the fix is to upgrade the cloudcreativity/json-api-testing dependency to ^2.0. I've also tagged 1.5.0 of this package as well.

All 4 comments

This is caused by a method of the same name was added in 6.2, which caused the collision: https://github.com/laravel/framework/pull/30125

Sending PR.

Actually @lindyhopchris has already fixed this issue. One step ahead, like always:

https://github.com/cloudcreativity/json-api-testing/commit/d3d5ec1de57519538ab9103266731a604aa9a6a3

We might just need it tagged and updated in this package.

Yeah spot on, I have already fixed this, though have forgotten I need to tag and release.

Won't take me too long to sort out, will hopefully have time this afternoon (UK time).

Just released this, the fix is to upgrade the cloudcreativity/json-api-testing dependency to ^2.0. I've also tagged 1.5.0 of this package as well.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

petenys picture petenys  路  5Comments

daryledesilva picture daryledesilva  路  6Comments

nelson6e65 picture nelson6e65  路  3Comments

GregPeden picture GregPeden  路  5Comments

danherd picture danherd  路  7Comments