Skip to content

Commit

Permalink
MNT Fix unit test providers
Browse files Browse the repository at this point in the history
  • Loading branch information
GuySartorelli committed Feb 13, 2025
1 parent 9d4e46d commit 1e09de0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
6 changes: 3 additions & 3 deletions tests/php/Forms/GridField/GridFieldPrintButtonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
Expand Down
6 changes: 2 additions & 4 deletions tests/php/ORM/DataObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -2870,7 +2868,7 @@ public function plural_name()
{
return 'Clouds';
}
public function classDescription()
public function classDescription(): ?string
{
return $this->classDescription;
}
Expand Down

0 comments on commit 1e09de0

Please sign in to comment.