DEF STUDIO srl

Authentication Expectations

toBeAbleTo()

Assert that the given User is authorized to do something.

expect($user)->toBeAbleTo('edit', $post);

toBeAuthenticated()

Assert that the given User is authenticated.

expect($user)->toBeAuthenticated();

toBeInvalidCredentials()

Assert that the given credentials are invalid.

expect(['email' => '[email protected]', 'password' => 'wrongpassword'])->toBeInvalidCredentials();

toBeValidCredentials()

Assert that the given credentials are valid.

expect(['email' => '[email protected]', 'password' => 'foo'])->toBeValidCredentials();
Suggest a change
Last updated 10 September 2024