mercredi 2 mars 2016

PHPUnit says route not defined (Laravel TestCase)

I run a unit-test on routing. Funny thing: PHPUnit says "all good" for the first test in a file, but fails with "route not defined" for exactly the same test if only it 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.

Anyone know why this occurs?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire