Skip to content

Commit

Permalink
MNT Fix unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Dec 16, 2024
1 parent a1ae139 commit bfe6f94
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 2 additions & 4 deletions tests/php/Forms/DropdownFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ public function testEmptySourceDoesntBlockValidation()
$this->assertTrue($field->validate()->isValid());
}

public function provideGetDefaultValue(): array
public static function provideGetDefaultValue(): array
{
return [
[
Expand Down Expand Up @@ -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']);
Expand Down
4 changes: 2 additions & 2 deletions tests/php/Forms/TreeDropdownFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bfe6f94

Please sign in to comment.