diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f7b9ad0..ed63dbd 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -151,13 +151,13 @@ jobs: - name: Upload Screenshots if: failure() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: screenshots path: tests/Browser/screenshots - name: Upload Console Logs if: failure() - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v3 with: name: console path: tests/Browser/console diff --git a/routes/web.php b/routes/web.php index 6ed2435..081a6f4 100644 --- a/routes/web.php +++ b/routes/web.php @@ -25,7 +25,7 @@ }); Route::middleware(['web'])->group(function () { - // Add social routes + // Add social redirect and callback routes Route::get('auth/{driver}/redirect', [SocialController::class, 'redirect']); Route::get('auth/{driver}/callback', [SocialController::class, 'callback']); diff --git a/src/Actions/TwoFactorAuth/GenerateQrCodeAndSecretKey.php b/src/Actions/TwoFactorAuth/GenerateQrCodeAndSecretKey.php index a4860df..af3227c 100644 --- a/src/Actions/TwoFactorAuth/GenerateQrCodeAndSecretKey.php +++ b/src/Actions/TwoFactorAuth/GenerateQrCodeAndSecretKey.php @@ -21,7 +21,7 @@ class GenerateQrCodeAndSecretKey public function __invoke($user): array { - $google2fa = new Google2FA(); + $google2fa = new Google2FA; $secret_key = $google2fa->generateSecretKey(); $this->companyName = 'Auth'; @@ -38,7 +38,7 @@ public function __invoke($user): array $writer = new Writer( new ImageRenderer( new RendererStyle(800), - new ImagickImageBackEnd() + new ImagickImageBackEnd ) ); diff --git a/src/AuthServiceProvider.php b/src/AuthServiceProvider.php index 4e0e185..081c5ed 100644 --- a/src/AuthServiceProvider.php +++ b/src/AuthServiceProvider.php @@ -144,7 +144,7 @@ public function register() // Bind a singleton for the Google2FA service $this->app->singleton(Google2FA::class, function ($app) { - return new Google2FA(); + return new Google2FA; }); // Register the DuskServiceProvider diff --git a/src/Traits/HasConfigs.php b/src/Traits/HasConfigs.php index 38f5bfb..6220b2b 100644 --- a/src/Traits/HasConfigs.php +++ b/src/Traits/HasConfigs.php @@ -30,7 +30,7 @@ private function arrayToObject($array) return $array; } - $object = new \stdClass(); + $object = new \stdClass; foreach ($array as $key => $value) { $object->$key = $this->arrayToObject($value); } diff --git a/tests/Browser/LogoutTest.php b/tests/Browser/LogoutTest.php deleted file mode 100644 index e69de29..0000000 diff --git a/tests/DuskTestCase.php b/tests/DuskTestCase.php index e2e8590..8b4e479 100644 --- a/tests/DuskTestCase.php +++ b/tests/DuskTestCase.php @@ -13,12 +13,6 @@ abstract class DuskTestCase extends BaseTestCase { use UsesDuskApiConfig; - // protected function setUp(): void - // { - // // $this->resetConfig(); - // parent::setUp(); - // } - /** * Prepare for Dusk test execution. */ @@ -26,7 +20,7 @@ abstract class DuskTestCase extends BaseTestCase public static function prepare(): void { if (! static::runningInSail()) { - static::startChromeDriver(); + static::startChromeDriver(['--port=9515']); } } diff --git a/tests/Pest.php b/tests/Pest.php index 50e4fe7..1db7284 100644 --- a/tests/Pest.php +++ b/tests/Pest.php @@ -5,8 +5,6 @@ // Illuminate\Foundation\Testing\DatabaseMigrations::class, )->in('Browser'); -use Illuminate\Foundation\Testing\RefreshDatabase; - /* |-------------------------------------------------------------------------- | Test Case @@ -14,14 +12,13 @@ | | The closure you provide to your test functions is always bound to a specific PHPUnit test | case class. By default, that class is "PHPUnit\Framework\TestCase". Of course, you may -| need to change it using the "uses()" function to bind a different classes or traits. +| need to change it using the "pest()" function to bind a different classes or traits. | */ -uses( - Tests\TestCase::class, - RefreshDatabase::class, -)->in('Feature'); +pest()->extend(Tests\TestCase::class) + ->use(Illuminate\Foundation\Testing\RefreshDatabase::class) + ->in('Feature'); /* |-------------------------------------------------------------------------- diff --git a/tests/TestCase.php b/tests/TestCase.php index f1ac0a1..fe1ffc2 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -3,14 +3,8 @@ namespace Tests; use Illuminate\Foundation\Testing\TestCase as BaseTestCase; -use Illuminate\Support\Facades\Artisan; abstract class TestCase extends BaseTestCase { - protected function setUp(): void - { - parent::setUp(); - Artisan::call('view:clear'); - - } + // }