I run a unit-test on routing. Funny thing is: PHPUnit says "all good" for the first test in a test file, but fails with "route not defined" for exactly the same test if it only goes second in the file.
I tried to create dummy test with only
$this->assertTrue(true);
and put is as a first test, the second test doing some work, precisely:
$this->call('GET', "http:.....");
$this->assertRedirectedToRoute('login');
and it fails.
But this same test gives me success if it goes first in the file. Very strange.
Does anyone know why is it happening?
I solved the case. It was routing. In my \app\Http\routes.php
file I had inclusions.
The fix was changing require_once
to require
in my routes.php
file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With