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 Oct 15, 2023
1 parent 21acf10 commit 958e6cd
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 40 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/WorkbenchServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
32 changes: 8 additions & 24 deletions tests/Http/Controllers/WorkbenchControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ protected function getPackageProviders($app)
];
}

/**
* @test
*/
/** @test */
public function it_can_get_current_user_information()
{
$user = UserFactory::new()->create();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand All @@ -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();
Expand Down
16 changes: 4 additions & 12 deletions tests/Http/Middleware/CatchDefaultRouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,7 @@ protected function getPackageProviders($app)
];
}

/**
* @test
*/
/** @test */
public function it_would_redirect_to_workbench_path()
{
$user = UserFactory::new()->create();
Expand All @@ -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([
Expand All @@ -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([
Expand All @@ -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();
Expand Down

0 comments on commit 958e6cd

Please sign in to comment.