diff --git a/tests/php/Forms/GridField/GridFieldPrintButtonTest.php b/tests/php/Forms/GridField/GridFieldPrintButtonTest.php index e981cb0d156..241b439af2a 100644 --- a/tests/php/Forms/GridField/GridFieldPrintButtonTest.php +++ b/tests/php/Forms/GridField/GridFieldPrintButtonTest.php @@ -4,6 +4,7 @@ use LogicException; use ReflectionMethod; +use PHPUnit\Framework\Attributes\DataProvider; use SilverStripe\Dev\SapphireTest; use SilverStripe\Control\Controller; use SilverStripe\Dev\CSSContentParser; @@ -98,7 +99,7 @@ public function testGeneratePrintData() $this->assertSame($names, $foundNames); } - public function provideHandlePrintEscaping(): array + public static function provideHandlePrintEscaping(): array { return [ // Without data columns component @@ -193,9 +194,8 @@ public function provideHandlePrintEscaping(): array * Explicitly tests that the following are both true: * - XML entities are not double-escaped * - XSS attack vectors are not introduced - * - * @dataProvider provideHandlePrintEscaping */ + #[DataProvider('provideHandlePrintEscaping')] public function testHandlePrintEscaping(string|DBField $value, bool $useGridFieldDataColumns, string $expected): void { $component = new GridFieldPrintButton(); diff --git a/tests/php/ORM/DataObjectTest.php b/tests/php/ORM/DataObjectTest.php index 7ed3106a0f0..5ce748cbf70 100644 --- a/tests/php/ORM/DataObjectTest.php +++ b/tests/php/ORM/DataObjectTest.php @@ -2855,9 +2855,7 @@ public static function provideProvideI18nEntities(): array ]; } - /** - * @dataProvider provideProvideI18nEntities - */ + #[DataProvider('provideProvideI18nEntities')] public function testProvideI18nEntities(?string $classDescription, bool $expected): void { $obj = new class extends DataObject { @@ -2870,7 +2868,7 @@ public function plural_name() { return 'Clouds'; } - public function classDescription() + public function classDescription(): ?string { return $this->classDescription; }