Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Test failing on Laravel 6.1 #439

Closed
umbert-cobiro opened this issue Oct 11, 2019 · 4 comments
Closed

[BUG] Test failing on Laravel 6.1 #439

umbert-cobiro opened this issue Oct 11, 2019 · 4 comments

Comments

@umbert-cobiro
Copy link

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
@jstoone
Copy link
Contributor

jstoone commented Oct 11, 2019

This is caused by a method of the same name was added in 6.2, which caused the collision: laravel/framework#30125

Sending PR.

@jstoone
Copy link
Contributor

jstoone commented Oct 11, 2019

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

cloudcreativity/json-api-testing@d3d5ec1

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

@lindyhopchris
Copy link
Member

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).

@lindyhopchris lindyhopchris changed the title [BUG} Test failing on Laravel 6.2 [BUG] Test failing on Laravel 6.1 Oct 14, 2019
@lindyhopchris
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants