Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT Fix unit test providers #11615

Merged
merged 1 commit into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading