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 Nov 14, 2024
1 parent 22177c0 commit a08a119
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions tests/php/ORM/DataObjectTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use InvalidArgumentException;
use LogicException;
use PHPUnit\Framework\Attributes\DataProvider;
use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Dev\SapphireTest;
Expand All @@ -27,7 +28,6 @@
use SilverStripe\Model\ModelData;
use ReflectionMethod;
use stdClass;
use PHPUnit\Framework\Attributes\DataProvider;

class DataObjectTest extends SapphireTest
{
Expand Down Expand Up @@ -1913,7 +1913,7 @@ public function testManyManyUnlimitedRowCount()
$this->assertEquals(2, $player->Teams()->dataQuery()->query()->unlimitedRowCount());
}

public function provideSingularName(): array
public static function provideSingularName(): array
{
return [
[
Expand All @@ -1933,8 +1933,8 @@ public function provideSingularName(): array

/**
* Tests that singular_name() generates sensible defaults.
* @dataProvider provideSingularName
*/
#[DataProvider('provideSingularName')]
public function testSingularName(string $class, string $expected): void
{
i18n::set_locale('en_NZ');
Expand All @@ -1952,7 +1952,7 @@ public function testSingularName(string $class, string $expected): void
);
}

public function providePluralName(): array
public static function providePluralName(): array
{
return [
[
Expand Down Expand Up @@ -1984,8 +1984,8 @@ public function providePluralName(): array

/**
* Tests that plural_name() generates sensible defaults.
* @dataProvider providePluralName
*/
#[DataProvider('providePluralName')]
public function testPluralName(string $class, string $expected): void
{
i18n::set_locale('en_NZ');
Expand All @@ -2003,7 +2003,7 @@ public function testPluralName(string $class, string $expected): void
);
}

public function provideClassDescription(): array
public static function provideClassDescription(): array
{
return [
'no description by default' => [
Expand All @@ -2021,9 +2021,7 @@ public function provideClassDescription(): array
];
}

/**
* @dataProvider provideClassDescription
*/
#[DataProvider('provideClassDescription')]
public function testClassDescription(string $class, ?string $expected): void
{
i18n::set_locale('en_NZ');
Expand Down

0 comments on commit a08a119

Please sign in to comment.