diff --git a/tests/php/Forms/DropdownFieldTest.php b/tests/php/Forms/DropdownFieldTest.php index 8af81e7af1b..321546be928 100644 --- a/tests/php/Forms/DropdownFieldTest.php +++ b/tests/php/Forms/DropdownFieldTest.php @@ -601,7 +601,7 @@ public function testEmptySourceDoesntBlockValidation() $this->assertTrue($field->validate()->isValid()); } - public function provideGetDefaultValue(): array + public static function provideGetDefaultValue(): array { return [ [ @@ -648,9 +648,7 @@ public function provideGetDefaultValue(): array ]; } - /** - * @dataProvider provideGetDefaultValue - */ + #[DataProvider('provideGetDefaultValue')] public function testGetDefaultValue(mixed $value, bool $hasEmptyDefault, mixed $expected): void { $field = new DropdownField('MyField', source: ['one' => 'one', 'two' => 'two', '3' => 'three']); diff --git a/tests/php/Forms/TreeDropdownFieldTest.php b/tests/php/Forms/TreeDropdownFieldTest.php index fbf15de4f1e..cc2c67a2d4c 100644 --- a/tests/php/Forms/TreeDropdownFieldTest.php +++ b/tests/php/Forms/TreeDropdownFieldTest.php @@ -303,9 +303,9 @@ public function testTreeSearchUsingSubObject() $cssPath = 'ul.tree li#selector-TestTree-' . $subObject1->ID . ' li#selector-TestTree-' . $subObject1ChildB->ID . ' a'; $firstResult = $parser->getBySelector($cssPath); $this->assertEquals( - $subObject1ChildB->Name, + $subObject1ChildB->Title, (string)$firstResult[0], - $subObject1ChildB->Name . ' is found, nested under ' . $subObject1->Name + $subObject1ChildB->Title . ' is found, nested under ' . $subObject1->Title ); // other objects which don't contain the keyword 'SubObject' are not returned in search results