bertog's avatar

Test and Strange Exception behaviour

I was in doubt so I've written this little test:

 /** @test **/
    function it_test_if_failed()
    {
        $this->get('/not-present');

        $this->assertTrue(true);
    }

Why the test in Laravel 5.6 returns green while the route is obviously not present? Why it not raise the exception? And how I can revert to the previous behaviour?

Thanks in advance

Guido

0 likes
2 replies
zion's avatar

Because $this->assertTrue(true); is true. You're not testing if the route exists but simply if true == true.

bertog's avatar

Yes, but in Laravel 5.5 or 5.4 the test raise an exception saying the route does not exist.

Please or to participate in this conversation.