Closed digitalformula closed 3 years ago
Not sure what I was doing wrong but this just started working as expected above. These both work as expected:
$user = Sentinel::findByCredentials( [ 'login' => 'no-reply@acme.com' ] );
Sentinel::login( $user );
$response = $this->get('/auth/logout');
$response->assertRedirect('/auth/login');
$user = Sentinel::findByCredentials( [ 'login' => 'no-reply@acme.com' ] );
Sentinel::login( $user );
$response = $this->get('/projects');
$response->assertStatus(200)->assertSee('OHAI');
Your Environment
Expected behaviour
Expect to use
Sentinel::login($user)
with a valid$user
object and then assert HTTP 200 on a page that requires authentication.It appears this used to work in previous versions.
Actual behaviour
Page consistently returns 302 with an attempt to redirect to my login page. Can't use
actingAs()
due to:Steps to reproduce
Any test that requires a user to be authenticated.