diff --git a/tests/Feature/AuthPage/AboutPageTest.php b/tests/Feature/AuthPage/AboutPageTest.php index ed1ac4b96..c590949fd 100644 --- a/tests/Feature/AuthPage/AboutPageTest.php +++ b/tests/Feature/AuthPage/AboutPageTest.php @@ -2,14 +2,13 @@ namespace Tests\Feature\AuthPage; -use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; +#[\PHPUnit\Framework\Attributes\Group('auth-page')] class AboutPageTest extends TestCase { #[Test] - #[Group('f-about')] public function auAdminCanAccessThisPage(): void { $response = $this->actingAs($this->adminUser()) @@ -19,7 +18,6 @@ public function auAdminCanAccessThisPage(): void } #[Test] - #[Group('f-about')] public function auNormalUserCantAccessThisPage(): void { $response = $this->actingAs($this->normalUser()) diff --git a/tests/Feature/AuthPage/AllUrlsPageTest.php b/tests/Feature/AuthPage/AllUrlsPageTest.php index d7e2ee693..9decd7d47 100644 --- a/tests/Feature/AuthPage/AllUrlsPageTest.php +++ b/tests/Feature/AuthPage/AllUrlsPageTest.php @@ -3,14 +3,14 @@ namespace Tests\Feature\AuthPage; use App\Models\Url; -use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; +#[\PHPUnit\Framework\Attributes\Group('auth-page')] +#[\PHPUnit\Framework\Attributes\Group('link-page')] class AllUrlsPageTest extends TestCase { #[Test] - #[Group('f-allurl')] public function auAdminCanAccessThisPage(): void { $response = $this->actingAs($this->adminUser()) @@ -19,7 +19,6 @@ public function auAdminCanAccessThisPage(): void } #[Test] - #[Group('f-allurl')] public function auNormalUserCantAccessThisPage(): void { $response = $this->actingAs($this->normalUser()) @@ -30,7 +29,6 @@ public function auNormalUserCantAccessThisPage(): void /** * Admin can access user links and guest links table page */ - #[Group('f-allurl')] public function testAdminCanAccessUserLinksTablePage(): void { $user = $this->adminUser(); @@ -47,7 +45,6 @@ public function testAdminCanAccessUserLinksTablePage(): void /** * Non admin users can't access user links and guest links table page */ - #[Group('f-allurl')] public function testNonAdminUsersCantAccessUserLinksTablePage(): void { $user = $this->normalUser(); @@ -62,7 +59,6 @@ public function testNonAdminUsersCantAccessUserLinksTablePage(): void } #[Test] - #[Group('f-allurl')] public function auAdminCanDelete(): void { $url = Url::factory()->create(); @@ -78,7 +74,6 @@ public function auAdminCanDelete(): void } #[Test] - #[Group('f-allurl')] public function auNormalUserCantDelete(): void { $url = Url::factory()->create(); diff --git a/tests/Feature/AuthPage/DashboardPageTest.php b/tests/Feature/AuthPage/DashboardPageTest.php index 6083dabd1..64f0095a1 100644 --- a/tests/Feature/AuthPage/DashboardPageTest.php +++ b/tests/Feature/AuthPage/DashboardPageTest.php @@ -3,14 +3,14 @@ namespace Tests\Feature\AuthPage; use App\Models\Url; -use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; +#[\PHPUnit\Framework\Attributes\Group('auth-page')] +#[\PHPUnit\Framework\Attributes\Group('link-page')] class DashboardPageTest extends TestCase { #[Test] - #[Group('f-dashboard')] public function dCanAccessPage(): void { $response = $this->actingAs($this->normalUser()) @@ -20,7 +20,6 @@ public function dCanAccessPage(): void } #[Test] - #[Group('f-dashboard')] public function dCanDelete(): void { $url = Url::factory()->create(); @@ -37,7 +36,6 @@ public function dCanDelete(): void } #[Test] - #[Group('f-dashboard')] public function dAuthorizedUserCanAccessEditUrlPage(): void { $url = Url::factory()->create(); @@ -49,7 +47,6 @@ public function dAuthorizedUserCanAccessEditUrlPage(): void } #[Test] - #[Group('f-dashboard')] public function dCanUpdateUrl(): void { $url = Url::factory()->create(); diff --git a/tests/Feature/AuthPage/User/AccountTest.php b/tests/Feature/AuthPage/User/AccountTest.php index 97f7dd48c..cf3119a49 100644 --- a/tests/Feature/AuthPage/User/AccountTest.php +++ b/tests/Feature/AuthPage/User/AccountTest.php @@ -3,10 +3,11 @@ namespace Tests\Feature\AuthPage\User; use App\Models\User; -use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; +#[\PHPUnit\Framework\Attributes\Group('auth-page')] +#[\PHPUnit\Framework\Attributes\Group('user-page')] class AccountTest extends TestCase { protected function getRoute(mixed $value): string @@ -19,7 +20,6 @@ protected function postRoute(mixed $value): string return route('user.update', $value); } - #[Group('f-user')] public function testUsersCanAccessTheirOwnAccountPages(): void { $user = $this->normalUser(); @@ -29,7 +29,6 @@ public function testUsersCanAccessTheirOwnAccountPages(): void $response->assertOk(); } - #[Group('f-user')] public function testAdminCanAccessEveryUserAccountPage(): void { $response = $this->actingAs($this->adminUser()) @@ -38,7 +37,6 @@ public function testAdminCanAccessEveryUserAccountPage(): void $response->assertOk(); } - #[Group('f-user')] public function testUserCannotAccessAnotherUserSAccountPage(): void { $response = $this->actingAs($this->normalUser()) @@ -48,7 +46,6 @@ public function testUserCannotAccessAnotherUserSAccountPage(): void } #[Test] - #[Group('f-user')] public function adminCanChangeOtherUsersEmail(): void { $user = User::factory()->create(['email' => 'user_email@urlhub.test']); @@ -67,7 +64,6 @@ public function adminCanChangeOtherUsersEmail(): void } #[Test] - #[Group('f-user')] public function normalUserCantChangeOtherUsersEmail(): void { $user = User::factory()->create(['email' => 'user2@urlhub.test']); @@ -83,7 +79,6 @@ public function normalUserCantChangeOtherUsersEmail(): void } #[Test] - #[Group('f-user')] public function validationEmailRequired(): void { $user = $this->normalUser(); @@ -100,7 +95,6 @@ public function validationEmailRequired(): void } #[Test] - #[Group('f-user')] public function validationEmailInvalidFormat(): void { $user = $this->normalUser(); @@ -117,7 +111,6 @@ public function validationEmailInvalidFormat(): void } #[Test] - #[Group('f-user')] public function validationEmailMaxLength(): void { $user = $this->normalUser(); @@ -135,7 +128,6 @@ public function validationEmailMaxLength(): void } #[Test] - #[Group('f-user')] public function validationEmailUnique(): void { $user = $this->normalUser(); diff --git a/tests/Feature/AuthPage/User/ChangePasswordTest.php b/tests/Feature/AuthPage/User/ChangePasswordTest.php index e043f99ac..64f5f0fa2 100644 --- a/tests/Feature/AuthPage/User/ChangePasswordTest.php +++ b/tests/Feature/AuthPage/User/ChangePasswordTest.php @@ -5,10 +5,11 @@ use App\Models\User; use Illuminate\Support\Facades\Hash; use PHPUnit\Framework\Attributes\DataProvider; -use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; +#[\PHPUnit\Framework\Attributes\Group('auth-page')] +#[\PHPUnit\Framework\Attributes\Group('user-page')] class ChangePasswordTest extends TestCase { protected User $user; @@ -35,7 +36,6 @@ protected function postRoute(mixed $value): string } #[Test] - #[Group('f-user')] public function changePasswordWithCorrectCredentials(): void { $response = $this->actingAs($this->user) @@ -56,7 +56,6 @@ public function changePasswordWithCorrectCredentials(): void } #[Test] - #[Group('f-user')] public function adminCanChangeThePasswordOfAllUsers(): void { $response = $this->actingAs($this->adminUser()) @@ -78,7 +77,6 @@ public function adminCanChangeThePasswordOfAllUsers(): void } #[Test] - #[Group('f-user')] public function currentPasswordDoesNotMatch(): void { $response = $this->actingAs($this->user) @@ -103,7 +101,6 @@ public function currentPasswordDoesNotMatch(): void * @param mixed $data2 */ #[Test] - #[Group('f-user')] #[DataProvider('newPasswordFailProvider')] public function newPasswordValidateFail($data1, $data2): void { @@ -144,7 +141,6 @@ public static function newPasswordFailProvider(): array * The new password must be different from the current password. */ #[Test] - #[Group('f-user')] #[DataProvider('newPasswordFailProvider')] public function newPasswordmustBeDifferent(): void { diff --git a/tests/Feature/AuthPage/UserListPageTest.php b/tests/Feature/AuthPage/UserListPageTest.php index 97a9fda1d..6c43f58cd 100644 --- a/tests/Feature/AuthPage/UserListPageTest.php +++ b/tests/Feature/AuthPage/UserListPageTest.php @@ -2,14 +2,14 @@ namespace Tests\Feature\AuthPage; -use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\Attributes\Test; use Tests\TestCase; +#[\PHPUnit\Framework\Attributes\Group('auth-page')] +#[\PHPUnit\Framework\Attributes\Group('link-page')] class UserListPageTest extends TestCase { #[Test] - #[Group('f-userlist')] public function ulpAdminCanAccessThisPage(): void { $response = $this->actingAs($this->adminUser()) @@ -19,7 +19,6 @@ public function ulpAdminCanAccessThisPage(): void } #[Test] - #[Group('f-userlist')] public function ulpNormalUserCantAccessThisPage(): void { $response = $this->actingAs($this->normalUser())