Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add authentication assertions to KernelBrowser #84

Merged
merged 1 commit into from
Apr 14, 2022

Conversation

kbond
Copy link
Member

@kbond kbond commented Apr 8, 2022

use Zenstruck\Browser\Component\Auth;

$this->browser()
    ->visit('/some/page')

    // fail if authenticated
    ->assertNotAuthenticated()

    ->actingAs($user)

    // fail if NOT authenticated
    ->assertAuthenticated()

    // fail if NOT authenticated or authenticated as a user other than "kevin"
    ->assertAuthenticated('kevin')
;

@kbond kbond added the enhancement New feature or request label Apr 8, 2022
@kbond kbond force-pushed the auth-component branch 2 times, most recently from 8097c97 to f0b6b5a Compare April 9, 2022 12:43
@kbond kbond changed the title Add Auth component that adds authentication assertions Add authentication assertions to KernelBrowser Apr 13, 2022
@kbond kbond merged commit 582d70f into zenstruck:1.x Apr 14, 2022
@kbond kbond deleted the auth-component branch April 14, 2022 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

Successfully merging this pull request may close these issues.

1 participant