diff --git a/resources/workflows/auth.yml b/resources/workflows/auth.yml index 86d14ae..c1efe1b 100644 --- a/resources/workflows/auth.yml +++ b/resources/workflows/auth.yml @@ -11,12 +11,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup PHP uses: shivammathur/setup-php@v2 with: - php-version: '8.2' + php-version: '8.3' extensions: mbstring, xml, ctype, iconv, mysql - name: Cache Composer Packages @@ -38,6 +38,9 @@ jobs: - name: Create sqlite file run: touch database/database.sqlite + - name: Copy .env + run: php -r "file_exists('.env') || copy('.env.example', '.env');" + - name: List out .env run: cat .env @@ -52,8 +55,8 @@ jobs: - name: Run the Auth Migrations run: php artisan migrate --path=vendor/devdojo/auth/database/migrations - - name: Install PestPHP - run: composer require pestphp/pest --dev --with-all-dependencies + - name: Install PestPHP and Laravel Dusk + run: composer require pestphp/pest laravel/dusk alebatistella/duskapiconf --dev --with-all-dependencies - name: Run Tests run: ./vendor/bin/pest diff --git a/tests/Feature/AuthenticationTest.php b/tests/Feature/AuthenticationTest.php index 23e77c9..13ed2a6 100644 --- a/tests/Feature/AuthenticationTest.php +++ b/tests/Feature/AuthenticationTest.php @@ -28,7 +28,7 @@ ->set('name', 'John Doe') ->call('register') ->assertHasNoErrors() - ->assertRedirect('/'); + ->assertRedirect(config('devdojo.auth.settings.redirect_after_auth')); $this->assertTrue(Auth::check()); $this->assertEquals('user@example.com', Auth::user()->email); @@ -92,7 +92,7 @@ ->set('name', 'John Doe') ->call('register') ->assertHasNoErrors() - ->assertRedirect('/'); + ->assertRedirect(config('devdojo.auth.settings.redirect_after_auth')); $this->assertTrue(Auth::check()); $this->assertEquals('user@example.com', Auth::user()->email); diff --git a/tests/Feature/TwoFactorTest.php b/tests/Feature/TwoFactorTest.php index a68b098..5abdb4e 100644 --- a/tests/Feature/TwoFactorTest.php +++ b/tests/Feature/TwoFactorTest.php @@ -28,7 +28,7 @@ ->set('password', 'password123') ->call('authenticate') ->assertHasNoErrors() - ->assertRedirect('/'); + ->assertRedirect(config('devdojo.auth.settings.redirect_after_auth')); $this->assertTrue(! Session::has('login.id')); }); @@ -58,7 +58,7 @@ ->set('password', 'password123') ->call('authenticate') ->assertHasNoErrors() - ->assertRedirect('/'); + ->assertRedirect(config('devdojo.auth.settings.redirect_after_auth')); }); it('user cannot view two factor challenge page logging in if it\'s disabled', function () {