I am testing a Laravel 5.1 page that requires the user to be logged in. My project uses the Cartalyst/Sentinel packing for authentication.
I tried this but I doesn't recognize that the user is logged in.
public function testPageWithLogin()
{
$user = Sentinel::findById(2);
$this->actingAs($user)
->withSession([])
->visit('/candidate/add')
->dontSee('Whoops')
->dontSee('login')
->see('List of Candidates');
}
What can I do so that the user will be seen as logged in?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire