assertStatus giving errors

Posted 3 months ago by matalina

New to testing. But not exactly sure why I'm getting this error on the frist run, and then it passes on the other two (at least that's what I'm assuming)

I have three Test classes that are identical (just the basic stub)


namespace Tests\Feature\Versirent;

use Tests\TestCase;
use Illuminate\Foundation\Testing\WithFaker;
use Illuminate\Foundation\Testing\RefreshDatabase;

class DocumentationTest extends TestCase
     * A basic feature test example.
     * @return void
    public function testExample()
        $response = $this->get('/');


The following error happens:

PHPUnit 6.5.7 by Sebastian Bergmann and contributors.

E..                                                                 3 / 3 (100%)

Time: 467 ms, Memory: 20.00MB

There was 1 error:

1) Tests\Feature\Versirent\DocumentationTest::testExample
ErrorException: Declaration of Illuminate\Foundation\Testing\Assert::assertArraySubset($subset, $array, bool $checkForObjectIdentity = false, string $message = ''): void should be compatible with PHPUnit\Framework\Assert::assertArraySubset($subset, $array, $strict = false, $message = '')


Tests: 3, Assertions: 2, Errors: 1.

if I comment out the $response->assertStatus(200); i get the expected no assertion test and then the second class/test fails for the above reason.

Everything is default phpunit settings that came when I ran the laravel composer scripts. And I've updated through composer as well.

Any ideas? Really at a loss for this and I'd really like to use the laravel helper methods as it's cleaner code.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.