matttonks11's avatar

Single test making multiple assertions

Hi,

I'm not sure if I'm missing something but whenever I run one or two tests in my test suite they seem to be making multiple assertions despite the test only having one assertion.

Here's an example to illustrate the point. When I include this test I get the output OK (12 tests, 21 assertions) If I comment it out however, my output is OK (11 tests, 19 assertions)

/** @test */
    public function a_guest_cannot_view_a_single_book()
    {
        $book = factory('App\Book')->create();
    
        $this->get($book->path())
            ->assertRedirect('/login');
    }

Something seems to be wrong because I only make a single assertion in that test?

Not sure if it's my code or something else, any help would be greatly appreciated

0 likes
2 replies

Please or to participate in this conversation.