diff options
| author | Greg Roach <greg@subaqua.co.uk> | 2024-03-26 11:38:51 +0000 |
|---|---|---|
| committer | Greg Roach <greg@subaqua.co.uk> | 2024-03-31 17:33:17 +0100 |
| commit | 202c018b592d5a516e4a465dc6dc515f3be37399 (patch) | |
| tree | 06e060fc19a494f1e5dcf89fc7ce04a8011e8176 /tests/app/Services | |
| parent | 1ff45046fabc22237b5d0d8e489c96f031fc598d (diff) | |
| download | webtrees-202c018b592d5a516e4a465dc6dc515f3be37399.tar.gz webtrees-202c018b592d5a516e4a465dc6dc515f3be37399.tar.bz2 webtrees-202c018b592d5a516e4a465dc6dc515f3be37399.zip | |
PHPUnit 11 deprecates docblocks, use annotations instead
Diffstat (limited to 'tests/app/Services')
34 files changed, 135 insertions, 312 deletions
diff --git a/tests/app/Services/AdminServiceTest.php b/tests/app/Services/AdminServiceTest.php index 424e097aa4..c2c62eca89 100644 --- a/tests/app/Services/AdminServiceTest.php +++ b/tests/app/Services/AdminServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class AdminService - * - * @covers \Fisharebest\Webtrees\Services\AdminService - */ + +#[CoversClass(AdminService::class)] class AdminServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\AdminService::class)); + $this->assertTrue(class_exists(AdminService::class)); } } diff --git a/tests/app/Services/CalendarServiceTest.php b/tests/app/Services/CalendarServiceTest.php index c04a5277f1..ca86fd08c2 100644 --- a/tests/app/Services/CalendarServiceTest.php +++ b/tests/app/Services/CalendarServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class CalendarService - * - * @covers \Fisharebest\Webtrees\Services\CalendarService - */ + +#[CoversClass(CalendarService::class)] class CalendarServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\CalendarService::class)); + $this->assertTrue(class_exists(CalendarService::class)); } } diff --git a/tests/app/Services/CaptchaServiceTest.php b/tests/app/Services/CaptchaServiceTest.php index 4d0bb1e2ad..da8f0eca6a 100644 --- a/tests/app/Services/CaptchaServiceTest.php +++ b/tests/app/Services/CaptchaServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class CaptchaService - * - * @covers \Fisharebest\Webtrees\Services\CaptchaService - */ + +#[CoversClass(CaptchaService::class)] class CaptchaServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\CaptchaService::class)); + $this->assertTrue(class_exists(CaptchaService::class)); } } diff --git a/tests/app/Services/ChartServiceTest.php b/tests/app/Services/ChartServiceTest.php index 6b16944613..dca75b66c6 100644 --- a/tests/app/Services/ChartServiceTest.php +++ b/tests/app/Services/ChartServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class ChartService - * - * @covers \Fisharebest\Webtrees\Services\ChartService - */ + +#[CoversClass(ChartService::class)] class ChartServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\ChartService::class)); + $this->assertTrue(class_exists(ChartService::class)); } } diff --git a/tests/app/Services/ClipboardServiceTest.php b/tests/app/Services/ClipboardServiceTest.php index 035defdb61..ad4babea09 100644 --- a/tests/app/Services/ClipboardServiceTest.php +++ b/tests/app/Services/ClipboardServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class ClipboardService - * - * @covers \Fisharebest\Webtrees\Services\ClipboardService - */ + +#[CoversClass(ClipboardService::class)] class ClipboardServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\ClipboardService::class)); + $this->assertTrue(class_exists(ClipboardService::class)); } } diff --git a/tests/app/Services/DataFixServiceTest.php b/tests/app/Services/DataFixServiceTest.php index 2c4fd7753f..39e9301ecf 100644 --- a/tests/app/Services/DataFixServiceTest.php +++ b/tests/app/Services/DataFixServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class DataFixService - * - * @covers \Fisharebest\Webtrees\Services\DataFixService - */ + +#[CoversClass(DataFixService::class)] class DataFixServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\DataFixService::class)); + $this->assertTrue(class_exists(DataFixService::class)); } } diff --git a/tests/app/Services/DatatablesServiceTest.php b/tests/app/Services/DatatablesServiceTest.php index e12753b1e6..8ba9ddc54d 100644 --- a/tests/app/Services/DatatablesServiceTest.php +++ b/tests/app/Services/DatatablesServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class DatatablesService - * - * @covers \Fisharebest\Webtrees\Services\DatatablesService - */ + +#[CoversClass(DatatablesService::class)] class DatatablesServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\DatatablesService::class)); + $this->assertTrue(class_exists(DatatablesService::class)); } } diff --git a/tests/app/Services/EmailServiceTest.php b/tests/app/Services/EmailServiceTest.php index 596c5ed951..d37b629fff 100644 --- a/tests/app/Services/EmailServiceTest.php +++ b/tests/app/Services/EmailServiceTest.php @@ -23,22 +23,18 @@ use Fisharebest\Webtrees\Contracts\UserInterface; use Fisharebest\Webtrees\Site; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; + +use PHPUnit\Framework\Attributes\DataProvider; + use function function_exists; -/** - * Test harness for the class EmailService - * - * @covers \Fisharebest\Webtrees\Services\EmailService - */ + +#[CoversClass(EmailService::class)] class EmailServiceTest extends TestCase { protected static bool $uses_database = true; - /** - * @covers \Fisharebest\Webtrees\Services\EmailService::send - * @covers \Fisharebest\Webtrees\Services\EmailService::message - * @covers \Fisharebest\Webtrees\Services\EmailService::transport - */ public function testSend(): void { $email_service = new EmailService(); @@ -113,19 +109,12 @@ U9VQQSQzY1oZMVX8i1m5WUTLPz2yLJIBQVdXqhMCQBGoiuSoSjafUhV7i1cEGpb88h5NBYZzWXGZ ]; } - /** - * @dataProvider emailProvider - * - * @covers \Fisharebest\Webtrees\Services\EmailService::isValidEmail - */ + #[DataProvider('emailProvider')] public function testIsValidEmail(string $email, bool $is_valid): void { self::assertSame($is_valid, (new EmailService())->isValidEmail($email)); } - /** - * @covers \Fisharebest\Webtrees\Services\EmailService::mailSslOptions - */ public function testMailSslOptions(): void { $options = (new EmailService())->mailSslOptions(); @@ -133,9 +122,6 @@ U9VQQSQzY1oZMVX8i1m5WUTLPz2yLJIBQVdXqhMCQBGoiuSoSjafUhV7i1cEGpb88h5NBYZzWXGZ self::assertArrayHasKey('ssl', $options); } - /** - * @covers \Fisharebest\Webtrees\Services\EmailService::mailTransportOptions - */ public function testMailTransportOptions(): void { $options = (new EmailService())->mailTransportOptions(); diff --git a/tests/app/Services/GedcomEditServiceTest.php b/tests/app/Services/GedcomEditServiceTest.php index df4071eb37..81aabdd2c7 100644 --- a/tests/app/Services/GedcomEditServiceTest.php +++ b/tests/app/Services/GedcomEditServiceTest.php @@ -21,19 +21,15 @@ namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; use Fisharebest\Webtrees\Tree; +use PHPUnit\Framework\Attributes\CoversClass; +use PHPUnit\Framework\Attributes\DataProvider; -/** - * Test harness for the class GedcomEditService - * - * @covers \Fisharebest\Webtrees\Services\GedcomEditService - */ + +#[CoversClass(GedcomEditService::class)] class GedcomEditServiceTest extends TestCase { protected static bool $uses_database = true; - /** - * @covers \Fisharebest\Webtrees\Services\GedcomEditService::editLinesToGedcom - */ public function testEditLinesToGedcom(): void { $gedcom_edit_service = new GedcomEditService(); @@ -112,11 +108,10 @@ class GedcomEditServiceTest extends TestCase } /** - * @dataProvider newFamilyFactsData - * * @param string $required_famfacts * @param array<string> $expected_new_facts */ + #[DataProvider('newFamilyFactsData')] public function testNewFamilyFacts(string $required_famfacts, array $expected_new_facts): void { $gedcom_edit_service = new GedcomEditService(); @@ -133,13 +128,10 @@ class GedcomEditServiceTest extends TestCase } /** - * @dataProvider newIndividualFactsData - * - * @param string $required_facts - * @param string $sex * @param array<string> $names * @param array<string> $expected_new_facts */ + #[DataProvider('newIndividualFactsData')] public function testNewIndividualFactsWithNoFacts( string $required_facts, string $sex, diff --git a/tests/app/Services/GedcomExportServiceTest.php b/tests/app/Services/GedcomExportServiceTest.php index 4d1e6e9444..a052b011f0 100644 --- a/tests/app/Services/GedcomExportServiceTest.php +++ b/tests/app/Services/GedcomExportServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class GedcomExportService - * - * @covers \Fisharebest\Webtrees\Services\GedcomExportService - */ + +#[CoversClass(GedcomExportService::class)] class GedcomExportServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\GedcomExportService::class)); + $this->assertTrue(class_exists(GedcomExportService::class)); } } diff --git a/tests/app/Services/GedcomImportServiceTest.php b/tests/app/Services/GedcomImportServiceTest.php index c877178a9e..ea5f440a54 100644 --- a/tests/app/Services/GedcomImportServiceTest.php +++ b/tests/app/Services/GedcomImportServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class GedcomImportService - * - * @covers \Fisharebest\Webtrees\Services\GedcomImportService - */ + +#[CoversClass(GedcomImportService::class)] class GedcomImportServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\GedcomImportService::class)); + $this->assertTrue(class_exists(GedcomImportService::class)); } } diff --git a/tests/app/Services/GedcomServiceTest.php b/tests/app/Services/GedcomServiceTest.php index 6323736b32..d58d094d7d 100644 --- a/tests/app/Services/GedcomServiceTest.php +++ b/tests/app/Services/GedcomServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class GedcomService - * - * @covers \Fisharebest\Webtrees\Services\GedcomService - */ + +#[CoversClass(GedcomService::class)] class GedcomServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\GedcomService::class)); + $this->assertTrue(class_exists(GedcomService::class)); } } diff --git a/tests/app/Services/HomePageServiceTest.php b/tests/app/Services/HomePageServiceTest.php index 820ac5f9f7..36b432178e 100644 --- a/tests/app/Services/HomePageServiceTest.php +++ b/tests/app/Services/HomePageServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class HomePageService - * - * @covers \Fisharebest\Webtrees\Services\HomePageService - */ + +#[CoversClass(HomePageService::class)] class HomePageServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\HomePageService::class)); + $this->assertTrue(class_exists(HomePageService::class)); } } diff --git a/tests/app/Services/HousekeepingServiceTest.php b/tests/app/Services/HousekeepingServiceTest.php index aafbe64547..55a02dffc1 100644 --- a/tests/app/Services/HousekeepingServiceTest.php +++ b/tests/app/Services/HousekeepingServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class HousekeepingService - * - * @covers \Fisharebest\Webtrees\Services\HousekeepingService - */ + +#[CoversClass(HousekeepingService::class)] class HousekeepingServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\HousekeepingService::class)); + $this->assertTrue(class_exists(HousekeepingService::class)); } } diff --git a/tests/app/Services/HtmlServiceTest.php b/tests/app/Services/HtmlServiceTest.php index 7d3cf9bb37..e6a7ebcdb7 100644 --- a/tests/app/Services/HtmlServiceTest.php +++ b/tests/app/Services/HtmlServiceTest.php @@ -20,15 +20,12 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class HtmlService - */ + +#[CoversClass(HtmlService::class)] class HtmlServiceTest extends TestCase { - /** - * @covers \Fisharebest\Webtrees\Services\HtmlService::sanitize - */ public function testAllowedHtml(): void { $html_service = new HtmlService(); @@ -39,9 +36,6 @@ class HtmlServiceTest extends TestCase self::assertSame($dirty, $clean); } - /** - * @covers \Fisharebest\Webtrees\Services\HtmlService::sanitize - */ public function testDisallowedHtml(): void { $html_service = new HtmlService(); diff --git a/tests/app/Services/IndividualFactsServiceTest.php b/tests/app/Services/IndividualFactsServiceTest.php index 322fc72df8..7a9f7457b7 100644 --- a/tests/app/Services/IndividualFactsServiceTest.php +++ b/tests/app/Services/IndividualFactsServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class IndividualFactsService - * - * @covers \Fisharebest\Webtrees\Services\IndividualFactsService - */ + +#[CoversClass(IndividualFactsService::class)] class IndividualFactsServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\IndividualFactsService::class)); + $this->assertTrue(class_exists(IndividualFactsService::class)); } } diff --git a/tests/app/Services/LeafletJsServiceTest.php b/tests/app/Services/LeafletJsServiceTest.php index 0c2f1165e0..01a44daf22 100644 --- a/tests/app/Services/LeafletJsServiceTest.php +++ b/tests/app/Services/LeafletJsServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class LeafletJsService - * - * @covers \Fisharebest\Webtrees\Services\LeafletJsService - */ + +#[CoversClass(LeafletJsService::class)] class LeafletJsServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\LeafletJsService::class)); + $this->assertTrue(class_exists(LeafletJsService::class)); } } diff --git a/tests/app/Services/LinkedRecordServiceTest.php b/tests/app/Services/LinkedRecordServiceTest.php index 877cc270bc..db64df04cf 100644 --- a/tests/app/Services/LinkedRecordServiceTest.php +++ b/tests/app/Services/LinkedRecordServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class LinkedRecordService - * - * @covers \Fisharebest\Webtrees\Services\LinkedRecordService - */ + +#[CoversClass(LinkedRecordService::class)] class LinkedRecordServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\LinkedRecordService::class)); + $this->assertTrue(class_exists(LinkedRecordService::class)); } } diff --git a/tests/app/Services/MapDataServiceTest.php b/tests/app/Services/MapDataServiceTest.php index fdae1f31ed..bc487d98d0 100644 --- a/tests/app/Services/MapDataServiceTest.php +++ b/tests/app/Services/MapDataServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class MapDataService - * - * @covers \Fisharebest\Webtrees\Services\MapDataService - */ + +#[CoversClass(MapDataService::class)] class MapDataServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\MapDataService::class)); + $this->assertTrue(class_exists(MapDataService::class)); } } diff --git a/tests/app/Services/MediaFileServiceTest.php b/tests/app/Services/MediaFileServiceTest.php index 0bb181041d..f844c4b243 100644 --- a/tests/app/Services/MediaFileServiceTest.php +++ b/tests/app/Services/MediaFileServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class MediaFileService - * - * @covers \Fisharebest\Webtrees\Services\MediaFileService - */ + +#[CoversClass(MediaFileService::class)] class MediaFileServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\MediaFileService::class)); + $this->assertTrue(class_exists(MediaFileService::class)); } } diff --git a/tests/app/Services/MessageServiceTest.php b/tests/app/Services/MessageServiceTest.php index 4c0abf27db..5fe027e611 100644 --- a/tests/app/Services/MessageServiceTest.php +++ b/tests/app/Services/MessageServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class MessageService - * - * @covers \Fisharebest\Webtrees\Services\MessageService - */ + +#[CoversClass(MessageService::class)] class MessageServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\MessageService::class)); + $this->assertTrue(class_exists(MessageService::class)); } } diff --git a/tests/app/Services/MigrationServiceTest.php b/tests/app/Services/MigrationServiceTest.php index 59370dea2b..893b5067e2 100644 --- a/tests/app/Services/MigrationServiceTest.php +++ b/tests/app/Services/MigrationServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class MigrationService - * - * @covers \Fisharebest\Webtrees\Services\MigrationService - */ + +#[CoversClass(MigrationService::class)] class MigrationServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\MigrationService::class)); + $this->assertTrue(class_exists(MigrationService::class)); } } diff --git a/tests/app/Services/ModuleServiceTest.php b/tests/app/Services/ModuleServiceTest.php index 9a4d6882d8..c27b7b2515 100644 --- a/tests/app/Services/ModuleServiceTest.php +++ b/tests/app/Services/ModuleServiceTest.php @@ -33,22 +33,13 @@ use Fisharebest\Webtrees\Module\ModuleSidebarInterface; use Fisharebest\Webtrees\Module\ModuleTabInterface; use Fisharebest\Webtrees\Module\ModuleThemeInterface; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test the modules - * - * @coversNothing - */ +#[CoversClass(ModuleService::class)] class ModuleServiceTest extends TestCase { protected static bool $uses_database = true; - /** - * @covers \Fisharebest\Webtrees\Services\ModuleService::all - * @covers \Fisharebest\Webtrees\Services\ModuleService::coreModules - * @covers \Fisharebest\Webtrees\Services\ModuleService::customModules - * @covers \Fisharebest\Webtrees\Services\ModuleService::moduleComparator - */ public function testAll(): void { $module_service = new ModuleService(); @@ -56,12 +47,6 @@ class ModuleServiceTest extends TestCase self::assertNotEmpty($module_service->all()->all()); } - /** - * @covers \Fisharebest\Webtrees\Services\ModuleService::findByComponent - * @covers \Fisharebest\Webtrees\Services\ModuleService::menuComparator - * @covers \Fisharebest\Webtrees\Services\ModuleService::sidebarComparator - * @covers \Fisharebest\Webtrees\Services\ModuleService::tabComparator - */ public function testFindByComponent(): void { $user_service = new UserService(); @@ -78,9 +63,6 @@ class ModuleServiceTest extends TestCase self::assertNotEmpty($module_service->findByComponent(ModuleTabInterface::class, $tree, $user)->all()); } - /** - * @covers \Fisharebest\Webtrees\Services\ModuleService::findByInterface - */ public function testFindByInterface(): void { $module_service = new ModuleService(); @@ -101,9 +83,6 @@ class ModuleServiceTest extends TestCase self::assertEmpty($module_service->findByInterface('not-a-valid-class-or-interface')->all()); } - /** - * @covers \Fisharebest\Webtrees\Services\ModuleService::otherModules - */ public function testOtherModules(): void { DB::table('module')->insert(['module_name' => 'not-a-module']); @@ -117,9 +96,6 @@ class ModuleServiceTest extends TestCase self::assertSame(4, $modules->count()); } - /** - * @covers \Fisharebest\Webtrees\Services\ModuleService::deletedModules - */ public function testDeletedModules(): void { DB::table('module')->insert(['module_name' => 'not-a-module']); diff --git a/tests/app/Services/PendingChangesServiceTest.php b/tests/app/Services/PendingChangesServiceTest.php index 087a08a859..5210b187b8 100644 --- a/tests/app/Services/PendingChangesServiceTest.php +++ b/tests/app/Services/PendingChangesServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class PendingChangesService - * - * @covers \Fisharebest\Webtrees\Services\PendingChangesService - */ + +#[CoversClass(PendingChangesService::class)] class PendingChangesServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\PendingChangesService::class)); + $this->assertTrue(class_exists(PendingChangesService::class)); } } diff --git a/tests/app/Services/RateLimitServiceTest.php b/tests/app/Services/RateLimitServiceTest.php index 13a8766cce..902603afdd 100644 --- a/tests/app/Services/RateLimitServiceTest.php +++ b/tests/app/Services/RateLimitServiceTest.php @@ -24,19 +24,17 @@ use Fisharebest\Webtrees\Http\Exceptions\HttpTooManyRequestsException; use Fisharebest\Webtrees\TestCase; use LogicException; +use PHPUnit\Framework\Attributes\CoversClass; + use function explode; use function implode; use function range; use function time; -/** - * Test harness for the class RateLimitService - */ + +#[CoversClass(RateLimitService::class)] class RateLimitServiceTest extends TestCase { - /** - * @covers \Fisharebest\Webtrees\Services\RateLimitService - */ public function testTooMuchHistory(): void { $rate_limit_service = new RateLimitService(); @@ -48,9 +46,6 @@ class RateLimitServiceTest extends TestCase $rate_limit_service->limitRateForUser($user, 1000, 30, 'rate-limit'); } - /** - * @covers \Fisharebest\Webtrees\Services\RateLimitService - */ public function testLimitNotReached(): void { $rate_limit_service = new RateLimitService(); @@ -70,9 +65,6 @@ class RateLimitServiceTest extends TestCase static::assertCount(3, explode(',', $history)); } - /** - * @covers \Fisharebest\Webtrees\Services\RateLimitService - */ public function testOldEventsIgnored(): void { $rate_limit_service = new RateLimitService(); @@ -87,9 +79,6 @@ class RateLimitServiceTest extends TestCase static::assertCount(6, explode(',', $history)); } - /** - * @covers \Fisharebest\Webtrees\Services\RateLimitService - */ public function testLimitReached(): void { $rate_limit_service = new RateLimitService(); diff --git a/tests/app/Services/RelationshipServiceTest.php b/tests/app/Services/RelationshipServiceTest.php index a5ad955204..f74ec49991 100644 --- a/tests/app/Services/RelationshipServiceTest.php +++ b/tests/app/Services/RelationshipServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class RelationshipService - * - * @covers \Fisharebest\Webtrees\Services\RelationshipService - */ + +#[CoversClass(RelationshipService::class)] class RelationshipServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\RelationshipService::class)); + $this->assertTrue(class_exists(RelationshipService::class)); } } diff --git a/tests/app/Services/RomanNumeralsServiceTest.php b/tests/app/Services/RomanNumeralsServiceTest.php index 8df16a3d4b..e5ab4e69ff 100644 --- a/tests/app/Services/RomanNumeralsServiceTest.php +++ b/tests/app/Services/RomanNumeralsServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class RomanNumeralsService - * - * @covers \Fisharebest\Webtrees\Services\RomanNumeralsService - */ + +#[CoversClass(RomanNumeralsService::class)] class RomanNumeralsServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\RomanNumeralsService::class)); + $this->assertTrue(class_exists(RomanNumeralsService::class)); } } diff --git a/tests/app/Services/SearchServiceTest.php b/tests/app/Services/SearchServiceTest.php index cbc71f92ad..77e8ab3b9c 100644 --- a/tests/app/Services/SearchServiceTest.php +++ b/tests/app/Services/SearchServiceTest.php @@ -21,12 +21,10 @@ namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; use Illuminate\Support\Collection; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class SearchService - * - * @covers \Fisharebest\Webtrees\Services\SearchService - */ + +#[CoversClass(SearchService::class)] class SearchServiceTest extends TestCase { protected static bool $uses_database = true; diff --git a/tests/app/Services/ServerCheckServiceTest.php b/tests/app/Services/ServerCheckServiceTest.php index 4b412418ee..00dbff326d 100644 --- a/tests/app/Services/ServerCheckServiceTest.php +++ b/tests/app/Services/ServerCheckServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class ServerCheckService - * - * @covers \Fisharebest\Webtrees\Services\ServerCheckService - */ + +#[CoversClass(ServerCheckService::class)] class ServerCheckServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\ServerCheckService::class)); + $this->assertTrue(class_exists(ServerCheckService::class)); } } diff --git a/tests/app/Services/SiteLogsServiceTest.php b/tests/app/Services/SiteLogsServiceTest.php index be2de10dda..894afc86ba 100644 --- a/tests/app/Services/SiteLogsServiceTest.php +++ b/tests/app/Services/SiteLogsServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class SiteLogsService - * - * @covers \Fisharebest\Webtrees\Services\SiteLogsService - */ + +#[CoversClass(SiteLogsService::class)] class SiteLogsServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\SiteLogsService::class)); + $this->assertTrue(class_exists(SiteLogsService::class)); } } diff --git a/tests/app/Services/TimeoutServiceTest.php b/tests/app/Services/TimeoutServiceTest.php index 5f77467762..9936e09ee4 100644 --- a/tests/app/Services/TimeoutServiceTest.php +++ b/tests/app/Services/TimeoutServiceTest.php @@ -23,6 +23,7 @@ use Fisharebest\Webtrees\Contracts\TimeFactoryInterface; use Fisharebest\Webtrees\MockGlobalFunctions; use Fisharebest\Webtrees\Registry; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; /** * Mock function. @@ -40,9 +41,8 @@ function ini_get(...$args) return TestCase::$mock_functions->iniGet(...$args); } -/** - * Test harness for the class TimeoutService - */ + +#[CoversClass(TimeoutService::class)] class TimeoutServiceTest extends TestCase { protected function setUp(): void @@ -59,10 +59,6 @@ class TimeoutServiceTest extends TestCase self::$mock_functions = null; } - /** - * @covers \Fisharebest\Webtrees\Services\TimeoutService::__construct - * @covers \Fisharebest\Webtrees\Services\TimeoutService::isTimeNearlyUp - */ public function testNoTimeOut(): void { $now = 1500000000.0; @@ -77,10 +73,6 @@ class TimeoutServiceTest extends TestCase self::assertFalse($timeout_service->isTimeNearlyUp()); } - /** - * @covers \Fisharebest\Webtrees\Services\TimeoutService::__construct - * @covers \Fisharebest\Webtrees\Services\TimeoutService::isTimeNearlyUp - */ public function testTimeOutReached(): void { $now = 1500000000.0; @@ -99,10 +91,6 @@ class TimeoutServiceTest extends TestCase self::assertTrue($timeout_service->isTimeNearlyUp()); } - /** - * @covers \Fisharebest\Webtrees\Services\TimeoutService::__construct - * @covers \Fisharebest\Webtrees\Services\TimeoutService::isTimeNearlyUp - */ public function testTimeOutNotReached(): void { $now = Registry::timeFactory()->now(); @@ -121,10 +109,6 @@ class TimeoutServiceTest extends TestCase self::assertFalse($timeout_service->isTimeNearlyUp()); } - /** - * @covers \Fisharebest\Webtrees\Services\TimeoutService::__construct - * @covers \Fisharebest\Webtrees\Services\TimeoutService::isTimeLimitUp - */ public function testTimeLimitNotReached(): void { $now = Registry::timeFactory()->now(); @@ -138,10 +122,6 @@ class TimeoutServiceTest extends TestCase self::assertFalse($timeout_service->isTimeLimitUp()); } - /** - * @covers \Fisharebest\Webtrees\Services\TimeoutService::__construct - * @covers \Fisharebest\Webtrees\Services\TimeoutService::isTimeLimitUp - */ public function testTimeLimitReached(): void { $now = Registry::timeFactory()->now(); diff --git a/tests/app/Services/TreeServiceTest.php b/tests/app/Services/TreeServiceTest.php index 0852154bb7..818c2c8370 100644 --- a/tests/app/Services/TreeServiceTest.php +++ b/tests/app/Services/TreeServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class TreeService - * - * @covers \Fisharebest\Webtrees\Services\TreeService - */ + +#[CoversClass(TreeService::class)] class TreeServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\TreeService::class)); + $this->assertTrue(class_exists(TreeService::class)); } } diff --git a/tests/app/Services/UpgradeServiceTest.php b/tests/app/Services/UpgradeServiceTest.php index 57df44975b..bcde08a066 100644 --- a/tests/app/Services/UpgradeServiceTest.php +++ b/tests/app/Services/UpgradeServiceTest.php @@ -20,16 +20,14 @@ declare(strict_types=1); namespace Fisharebest\Webtrees\Services; use Fisharebest\Webtrees\TestCase; +use PHPUnit\Framework\Attributes\CoversClass; -/** - * Test harness for the class UpgradeService - * - * @covers \Fisharebest\Webtrees\Services\UpgradeService - */ + +#[CoversClass(UpgradeService::class)] class UpgradeServiceTest extends TestCase { public function testClass(): void { - $this->assertTrue(class_exists(\Fisharebest\Webtrees\Services\UpgradeService::class)); + $this->assertTrue(class_exists(UpgradeService::class)); } } diff --git a/tests/app/Services/UserServiceTest.php b/tests/app/Services/UserServiceTest.php index a53b093610..01d116e807 100644 --- a/tests/app/Services/UserServiceTest.php +++ b/tests/app/Services/UserServiceTest.php @@ -22,11 +22,11 @@ namespace Fisharebest\Webtrees; use Fisharebest\Webtrees\Contracts\CacheFactoryInterface; use Fisharebest\Webtrees\Contracts\UserInterface; use Fisharebest\Webtrees\Services\UserService; +use PHPUnit\Framework\Attributes\CoversClass; use Symfony\Component\Cache\Adapter\NullAdapter; -/** - * Test the UserService class - */ + +#[CoversClass(UserService::class)] class UserServiceTest extends TestCase { protected static bool $uses_database = true; @@ -43,9 +43,6 @@ class UserServiceTest extends TestCase Registry::cache($cache_factory); } - /** - * @covers \Fisharebest\Webtrees\Services\UserService::create - */ public function testCreate(): void { $user_service = new UserService(); @@ -55,9 +52,6 @@ class UserServiceTest extends TestCase self::assertSame(1, $user->id()); } - /** - * @covers \Fisharebest\Webtrees\Services\UserService::delete - */ public function testDelete(): void { $user_service = new UserService(); @@ -68,9 +62,6 @@ class UserServiceTest extends TestCase self::assertNull($user_service->find($user_id)); } - /** - * @covers \Fisharebest\Webtrees\Services\UserService::find - */ public function testFindNonExistingUser(): void { $user_service = new UserService(); @@ -79,9 +70,6 @@ class UserServiceTest extends TestCase self::assertNull($user); } - /** - * @covers \Fisharebest\Webtrees\Services\UserService::find - */ public function testFindExistingUser(): void { $user_service = new UserService(); @@ -91,9 +79,6 @@ class UserServiceTest extends TestCase self::assertSame($user1->id(), $user2->id()); } - /** - * @covers \Fisharebest\Webtrees\Services\UserService::findByEmail - */ public function testFindUserByEmail(): void { $user_service = new UserService(); @@ -103,9 +88,6 @@ class UserServiceTest extends TestCase self::assertSame($user1->id(), $user2->id()); } - /** - * @covers \Fisharebest\Webtrees\Services\UserService::findByUserName - */ public function testFindUserByUserName(): void { $user_service = new UserService(); @@ -115,9 +97,6 @@ class UserServiceTest extends TestCase self::assertSame($user1->id(), $user2->id()); } - /** - * @covers \Fisharebest\Webtrees\Services\UserService::findByIdentifier - */ public function testFindUserByIdentifier(): void { $user_service = new UserService(); @@ -129,9 +108,6 @@ class UserServiceTest extends TestCase self::assertSame($user1->id(), $user3->id()); } - /** - * @covers \Fisharebest\Webtrees\Services\UserService::findByIndividual - */ public function testFindUsersByIndividual(): void { $user_service = new UserService(); @@ -147,9 +123,6 @@ class UserServiceTest extends TestCase self::assertSame($user->id(), $users[0]->id()); } - /** - * @covers \Fisharebest\Webtrees\Services\UserService::all - */ public function testFindAllUsers(): void { $user_service = new UserService(); @@ -163,9 +136,6 @@ class UserServiceTest extends TestCase self::assertSame($user1->id(), $users[1]->id()); } - /** - * @covers \Fisharebest\Webtrees\Services\UserService::administrators - */ public function testFindAdministrators(): void { $user_service = new UserService(); @@ -180,9 +150,6 @@ class UserServiceTest extends TestCase self::assertSame($admin->id(), $users[0]->id()); } - /** - * @covers \Fisharebest\Webtrees\Services\UserService::managers - */ public function testFindManagers(): void { $user_service = new UserService(); @@ -203,9 +170,6 @@ class UserServiceTest extends TestCase self::assertSame($user1->id(), $users[0]->id()); } - /** - * @covers \Fisharebest\Webtrees\Services\UserService::moderators - */ public function testFindModerators(): void { $user_service = new UserService(); @@ -226,10 +190,6 @@ class UserServiceTest extends TestCase self::assertSame($user2->id(), $users[0]->id()); } - /** - * @covers \Fisharebest\Webtrees\Services\UserService::unapproved - * @covers \Fisharebest\Webtrees\Services\UserService::unverified - */ public function testFindUnapprovedAndUnverified(): void { $user_service = new UserService(); |
