From 840a059ef699667060adbf1e7917c716cff791c4 Mon Sep 17 00:00:00 2001 From: Devansh Bawari Date: Wed, 14 Aug 2024 17:09:57 +0530 Subject: [PATCH 1/3] test: tset fixing --- packages/Webkul/Admin/src/Http/helpers.php | 8 +++++--- packages/Webkul/WebForm/src/Http/helpers.php | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) 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); + } } From 8e05ee59f12abdc46ba90bde3b5a5086de6ac0a9 Mon Sep 17 00:00:00 2001 From: Devansh Bawari Date: Wed, 14 Aug 2024 17:20:50 +0530 Subject: [PATCH 2/3] test: migrate phpunit xml files --- phpunit.xml | 31 +++++++++++++++++----------- phpunit.xml.bak | 27 ++++++++++++++++++++++++ tests/Feature/AuthenticationTest.php | 9 ++++---- 3 files changed, 50 insertions(+), 17 deletions(-) create mode 100644 phpunit.xml.bak 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/phpunit.xml.bak b/phpunit.xml.bak new file mode 100644 index 000000000..73739b730 --- /dev/null +++ b/phpunit.xml.bak @@ -0,0 +1,27 @@ + + + + + ./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) From 60f123015adc0ad8c484476b3e72d4f8780791c9 Mon Sep 17 00:00:00 2001 From: Devansh Bawari Date: Wed, 14 Aug 2024 17:24:12 +0530 Subject: [PATCH 3/3] feat: deleted unwanted files --- phpunit.xml.bak | 27 --------------------------- 1 file changed, 27 deletions(-) delete mode 100644 phpunit.xml.bak diff --git a/phpunit.xml.bak b/phpunit.xml.bak deleted file mode 100644 index 73739b730..000000000 --- a/phpunit.xml.bak +++ /dev/null @@ -1,27 +0,0 @@ - - - - - ./tests/Unit - - - ./tests/Feature - - - - - ./app - - - - - - - - - - - - - -