From 958e6cdd73c86098b21bdb4cf86d6983e385d8f7 Mon Sep 17 00:00:00 2001 From: Mior Muhammad Zaki Date: Sun, 15 Oct 2023 10:27:06 +0800 Subject: [PATCH] wip Signed-off-by: Mior Muhammad Zaki --- composer.json | 8 ++--- src/WorkbenchServiceProvider.php | 1 + .../Controllers/WorkbenchControllerTest.php | 32 +++++-------------- .../Http/Middleware/CatchDefaultRouteTest.php | 16 +++------- 4 files changed, 17 insertions(+), 40 deletions(-) diff --git a/composer.json b/composer.json index a243a82..51bd1ba 100644 --- a/composer.json +++ b/composer.json @@ -26,15 +26,15 @@ "require": { "php": "^8.0", "composer-runtime-api": "^2.2", - "illuminate/console": "^9.52.15 || ^10.23.0", - "illuminate/support": "^9.52.15 || ^10.23.0", + "illuminate/console": "^9.52.15 || ^10.26.0", + "illuminate/support": "^9.52.15 || ^10.26.0", "laravel/tinker": "^2.8.2", - "orchestra/canvas": "^7.10.0 || ^8.9.0", + "orchestra/canvas": "^7.10.0 || ^8.11.0", "orchestra/testbench-core": "^7.32.0 || ^8.12.0" }, "require-dev": { "fakerphp/faker": "^1.21", - "laravel/framework": "^9.52.15 || ^10.23.0", + "laravel/framework": "^9.52.15 || ^10.26.0", "laravel/pint": "^1.4", "mockery/mockery": "^1.5.1", "phpstan/phpstan": "^1.10.7", diff --git a/src/WorkbenchServiceProvider.php b/src/WorkbenchServiceProvider.php index 020d43e..cf66102 100644 --- a/src/WorkbenchServiceProvider.php +++ b/src/WorkbenchServiceProvider.php @@ -39,6 +39,7 @@ public function register(): void public function boot(): void { static::authenticationRoutes(); + $this->loadViewsFrom(Workbench::path('resources/views'), 'workbench'); $this->app->make(HttpKernel::class)->pushMiddleware(Http\Middleware\CatchDefaultRoute::class); diff --git a/tests/Http/Controllers/WorkbenchControllerTest.php b/tests/Http/Controllers/WorkbenchControllerTest.php index 77ddab8..370abc7 100644 --- a/tests/Http/Controllers/WorkbenchControllerTest.php +++ b/tests/Http/Controllers/WorkbenchControllerTest.php @@ -61,9 +61,7 @@ protected function getPackageProviders($app) ]; } - /** - * @test - */ + /** @test */ public function it_can_get_current_user_information() { $user = UserFactory::new()->create(); @@ -78,9 +76,7 @@ public function it_can_get_current_user_information() ]); } - /** - * @test - */ + /** @test */ public function it_can_get_current_user_information_without_authenticated_user_return_empty_array() { $user = UserFactory::new()->create(); @@ -91,9 +87,7 @@ public function it_can_get_current_user_information_without_authenticated_user_r $response->assertOk()->assertExactJson([]); } - /** - * @test - */ + /** @test */ public function it_can_authenticate_a_user() { $user = UserFactory::new()->create(); @@ -107,9 +101,7 @@ public function it_can_authenticate_a_user() ->assertAuthenticatedAs($user); } - /** - * @test - */ + /** @test */ public function it_can_authenticate_a_user_using_email() { $user = UserFactory::new()->create(); @@ -123,9 +115,7 @@ public function it_can_authenticate_a_user_using_email() ->assertAuthenticatedAs($user); } - /** - * @test - */ + /** @test */ public function it_can_deauthenticate_a_user() { $user = UserFactory::new()->create(); @@ -139,9 +129,7 @@ public function it_can_deauthenticate_a_user() $this->assertGuest('web'); } - /** - * @test - */ + /** @test */ public function it_can_automatically_authenticate_a_user() { $user = UserFactory::new()->create(); @@ -158,9 +146,7 @@ public function it_can_automatically_authenticate_a_user() ->assertAuthenticatedAs($user); } - /** - * @test - */ + /** @test */ public function it_can_automatically_authenticate_a_user_using_email() { $user = UserFactory::new()->create(); @@ -177,9 +163,7 @@ public function it_can_automatically_authenticate_a_user_using_email() ->assertAuthenticatedAs($user); } - /** - * @test - */ + /** @test */ public function it_can_automatically_deauthenticate_a_user() { $user = UserFactory::new()->create(); diff --git a/tests/Http/Middleware/CatchDefaultRouteTest.php b/tests/Http/Middleware/CatchDefaultRouteTest.php index 76b1d89..6654696 100644 --- a/tests/Http/Middleware/CatchDefaultRouteTest.php +++ b/tests/Http/Middleware/CatchDefaultRouteTest.php @@ -60,9 +60,7 @@ protected function getPackageProviders($app) ]; } - /** - * @test - */ + /** @test */ public function it_would_redirect_to_workbench_path() { $user = UserFactory::new()->create(); @@ -75,9 +73,7 @@ public function it_would_redirect_to_workbench_path() ->assertRedirect('/_workbench'); } - /** - * @test - */ + /** @test */ public function it_would_show_default_page() { $this->instance(ConfigContract::class, new Config([ @@ -102,9 +98,7 @@ public function it_would_show_default_page() ->assertOk(); } - /** - * @test - */ + /** @test */ public function it_would_not_redirect_to_workbench_path_if_configuration_doesnt_requires_it() { $this->instance(ConfigContract::class, new Config([ @@ -129,9 +123,7 @@ public function it_would_not_redirect_to_workbench_path_if_configuration_doesnt_ ->assertNotFound(); } - /** - * @test - */ + /** @test */ public function it_would_not_redirect_to_workbench_path_on_path_other_than_root() { $user = UserFactory::new()->create();