Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* fix: add redirect config value to redirect assertion

* fix: add redirect config value to redirect assertion

* fix: added check for .env.example and Dusk install

* fix spacing
  • Loading branch information
ch4r-ch4r authored Nov 17, 2024
1 parent aec1bf1 commit b5872fb
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
11 changes: 7 additions & 4 deletions resources/workflows/auth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/AuthenticationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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('[email protected]', Auth::user()->email);
Expand Down Expand Up @@ -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('[email protected]', Auth::user()->email);
Expand Down
4 changes: 2 additions & 2 deletions tests/Feature/TwoFactorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
});
Expand Down Expand Up @@ -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 () {
Expand Down

0 comments on commit b5872fb

Please sign in to comment.