diff --git a/packages/Webkul/Admin/src/Http/helpers.php b/packages/Webkul/Admin/src/Http/helpers.php index 4c78896d0..a40bfecd0 100755 --- a/packages/Webkul/Admin/src/Http/helpers.php +++ b/packages/Webkul/Admin/src/Http/helpers.php @@ -9,7 +9,9 @@ function bouncer() } } -function admin_vite(): AdminVite -{ - return app(AdminVite::class); +if (! function_exists('admin_vite')) { + function admin_vite(): AdminVite + { + return app(AdminVite::class); + } } diff --git a/packages/Webkul/WebForm/src/Http/helpers.php b/packages/Webkul/WebForm/src/Http/helpers.php index 449116b10..807f37736 100755 --- a/packages/Webkul/WebForm/src/Http/helpers.php +++ b/packages/Webkul/WebForm/src/Http/helpers.php @@ -2,7 +2,9 @@ use Webkul\WebForm\Vite as WebFormVite; -function webform_vite(): WebFormVite -{ - return app(WebFormVite::class); +if (! function_exists('webform_vite')) { + function webform_vite(): WebFormVite + { + return app(WebFormVite::class); + } } diff --git a/phpunit.xml b/phpunit.xml index 73739b730..5bc9705e6 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -1,27 +1,34 @@ - + ./tests/Unit + ./tests/Feature - + + ./app - + + - - - - - - - - - + + + + + + + diff --git a/tests/Feature/AuthenticationTest.php b/tests/Feature/AuthenticationTest.php index 68c0751ce..e959d86a8 100644 --- a/tests/Feature/AuthenticationTest.php +++ b/tests/Feature/AuthenticationTest.php @@ -1,22 +1,21 @@ get(route('admin.session.create')) ->assertOK(); }); -test('check dashboard page after login', function () { +it('can see the dashboard page after login', function () { $admin = getDefaultAdmin(); test()->actingAs($admin) ->get(route('admin.dashboard.index')) - ->assertSee(__('admin::app.dashboard.title')) - ->assertSee(getFirstName($admin->name)); + ->assertSee(__('admin::app.dashboard.title')); expect(auth()->guard('user')->user()->name)->toBe($admin->name); }); -test('check for admin logout', function () { +it('can logout from the admin panel', function () { $admin = getDefaultAdmin(); test()->actingAs($admin)