diff --git a/composer.json b/composer.json index edd8355..f2a7045 100644 --- a/composer.json +++ b/composer.json @@ -20,7 +20,7 @@ "silverstripe/cms": "^6" }, "require-dev": { - "phpunit/phpunit": "^9.6", + "phpunit/phpunit": "^11.3", "squizlabs/php_codesniffer": "^3", "symbiote/silverstripe-queuedjobs": "^6", "silverstripe/standards": "^1", diff --git a/tests/php/ExternalLinksTest.php b/tests/php/ExternalLinksTest.php index c6dd4a6..04d76db 100644 --- a/tests/php/ExternalLinksTest.php +++ b/tests/php/ExternalLinksTest.php @@ -13,6 +13,7 @@ use SilverStripe\ExternalLinks\Tests\Stubs\PretendLinkChecker; use SilverStripe\i18n\i18n; use SilverStripe\Reports\Report; +use PHPUnit\Framework\Attributes\DataProvider; class ExternalLinksTest extends FunctionalTest { @@ -127,7 +128,7 @@ public function testArchivedPagesAreHiddenFromReport() $this->assertEquals(3, BrokenExternalLinksReport::create()->sourceRecords()->count()); } - public function provideGetJobStatus(): array + public static function provideGetJobStatus(): array { return [ 'ADMIN - valid permission' => ['ADMIN', 200], @@ -136,9 +137,7 @@ public function provideGetJobStatus(): array ]; } - /** - * @dataProvider provideGetJobStatus - */ + #[DataProvider('provideGetJobStatus')] public function testGetJobStatus( string $permission, int $expectedResponseCode diff --git a/tests/php/Model/BrokenExternalLinkTest.php b/tests/php/Model/BrokenExternalLinkTest.php index ddfeb13..770eb54 100644 --- a/tests/php/Model/BrokenExternalLinkTest.php +++ b/tests/php/Model/BrokenExternalLinkTest.php @@ -4,12 +4,11 @@ use SilverStripe\Dev\SapphireTest; use SilverStripe\ExternalLinks\Model\BrokenExternalLink; +use PHPUnit\Framework\Attributes\DataProvider; class BrokenExternalLinkTest extends SapphireTest { - /** - * @dataProvider httpCodeProvider - */ + #[DataProvider('httpCodeProvider')] public function testGetHTTPCodeDescription(int $httpCode, string $expected) { $link = new BrokenExternalLink(); @@ -17,7 +16,7 @@ public function testGetHTTPCodeDescription(int $httpCode, string $expected) $this->assertSame($expected, $link->getHTTPCodeDescription()); } - public function httpCodeProvider(): array + public static function httpCodeProvider(): array { return [ [200, '200 (OK)'], @@ -28,7 +27,7 @@ public function httpCodeProvider(): array ]; } - public function permissionProvider(): array + public static function permissionProvider(): array { return [ ['admin', 'ADMIN'], @@ -37,9 +36,7 @@ public function permissionProvider(): array ]; } - /** - * @dataProvider permissionProvider - */ + #[DataProvider('permissionProvider')] public function testCanViewReport(string $user, string $permission) { $this->logOut();