Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Mior Muhammad Zaki <[email protected]>
  • Loading branch information
crynobone committed Jun 26, 2024
1 parent 0b23695 commit 6e74992
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 10 deletions.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@
"laravel/breeze": "^1.1",
"laravel/nova": "@dev",
"nunomaduro/collision": "^7.5",
"orchestra/testbench": "^8.22.2",
"orchestra/testbench-dusk": "^8.23",
"orchestra/testbench-core": "^8.24.4",
"orchestra/testbench-dusk": "^8.24.1",
"orchestra/workbench": "^8.0",
"phpunit/phpunit": "^10.5"
},
"conflict": {
Expand Down
3 changes: 2 additions & 1 deletion config/nova.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php

use Illuminate\Auth\Middleware\EnsureEmailIsVerified;
use Laravel\Nova\Actions\ActionResource;
use Laravel\Nova\Http\Middleware\Authenticate;
use Laravel\Nova\Http\Middleware\Authorize;
Expand Down Expand Up @@ -108,8 +109,8 @@
'api_middleware' => [
'nova',
Authenticate::class,
// EnsureEmailIsVerified::redirectTo('nova.pages.verification.notice'),
Authorize::class,
// 'nova.verified',
],

/*
Expand Down
15 changes: 8 additions & 7 deletions tests/Browser/CustomAuthenticatesUserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,18 @@
class CustomAuthenticatesUserTest extends DuskTestCase
{
/**
* Get package providers.
* Override application aliases.
*
* @api
*
* @param \Illuminate\Foundation\Application $app
* @return array<int, class-string>
* @return array<class-string, class-string>
*/
protected function getPackageProviders($app)
protected function overrideApplicationProviders($app)
{
return collect(parent::getPackageProviders($app))
->replace([
NovaServiceProvider::class => NovaWithoutAuthenticationServiceProvider::class,
])->all();
return [
NovaServiceProvider::class => NovaWithoutAuthenticationServiceProvider::class,
];
}

#[DataProvider('intendedUrlDataProvider')]
Expand Down
13 changes: 13 additions & 0 deletions tests/DuskTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Inertia\ServiceProvider as InertiaServiceProvider;
use Laravel\Dusk\Browser;
use Laravel\Fortify\FortifyServiceProvider;
use Laravel\Nova\Nova;
use Laravel\Nova\NovaCoreServiceProvider;
use Laravel\Nova\NovaServiceProvider;
use Laravel\Scout\ScoutServiceProvider;
Expand All @@ -32,6 +33,18 @@ public static function applicationBasePath()
return package_path(['vendor', 'laravel', 'nova-dusk-suite']);
}

/**
* Prepare the testing environment web driver options.
*
* @api
*
* @return void
*/
public static function defineWebDriverOptions()
{
Nova::$routesResolver = null;
}

/**
* Setup the test environment.
*/
Expand Down

0 comments on commit 6e74992

Please sign in to comment.