Skip to content

Commit

Permalink
DEP Use PHPUnit 11
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Sep 6, 2024
1 parent 7c53d75 commit bd65d5e
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
14 changes: 7 additions & 7 deletions tests/php/Controllers/LinkFieldControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function testLinkFormGetSchema(
}
}

public function provideLinkFormGetSchema(): array
public static function provideLinkFormGetSchema(): array
{
return [
'Valid existing record' => [
Expand Down Expand Up @@ -202,7 +202,7 @@ public function testExcludeLinkTextField(bool $excludeLinkTextField): void
}
}

public function provideExcludeLinkTextField(): array
public static function provideExcludeLinkTextField(): array
{
return [
'exclude field' => [
Expand Down Expand Up @@ -311,7 +311,7 @@ public function testLinkFormPost(
}
}

public function provideLinkFormPost(): array
public static function provideLinkFormPost(): array
{
// note: not duplicating code paths already tested with provideLinkFormGetSchema()
// e.g. Reject Invalid ID
Expand Down Expand Up @@ -444,7 +444,7 @@ public function testLinkFormReadonly(string $idType, string $fail, bool $expecte
$this->assertSame($expected, $actual);
}

public function provideLinkFormReadOnly(): array
public static function provideLinkFormReadOnly(): array
{
return [
[
Expand Down Expand Up @@ -495,7 +495,7 @@ public function testLinkData(
}
}

public function provideLinkData(): array
public static function provideLinkData(): array
{
return [
'Valid' => [
Expand Down Expand Up @@ -567,7 +567,7 @@ public function testLinkArchive(
}
}

public function provideLinkArchive(): array
public static function provideLinkArchive(): array
{
return [
'Valid' => [
Expand Down Expand Up @@ -669,7 +669,7 @@ public function testLinkSort(
);
}

public function provideLinkSort(): array
public static function provideLinkSort(): array
{
return [
'Success' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/php/Form/MultiLinkFieldTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class MultiLinkFieldTest extends SapphireTest
{
public function provideConvertValueToArray(): array
public static function provideConvertValueToArray(): array
{
return [
'empty string' => [
Expand Down
12 changes: 6 additions & 6 deletions tests/php/Models/LinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public function testLinkType(string $class, bool $expected): void
: $this->assertNull($linkTypeField, 'We do not expect to a find link type field');
}

public function linkTypeProvider(): array
public static function linkTypeProvider(): array
{
return [
[EmailLink::class, false],
Expand Down Expand Up @@ -152,7 +152,7 @@ public function testGetVersionedState(): void
$this->assertEquals('unversioned', $link->getVersionedState());
}

public function provideGetUrl(): array
public static function provideGetUrl(): array
{
return [
'internal link / page only' => [
Expand Down Expand Up @@ -242,7 +242,7 @@ public function testGetUrl(string $identifier, string $class, string $expected):
$this->assertSame($expected, $link->getURL(), 'We expect specific URL value');
}

function provideDefaultLinkTitle(): array
static function provideDefaultLinkTitle(): array
{
return [
'page link' => [
Expand Down Expand Up @@ -314,7 +314,7 @@ public function testDefaultLinkTitle(string $identifier, string $class, string $
$this->assertEquals($expected, $link->getTitle());
}

public function provideOwner()
public static function provideOwner()
{
return [
'null because there is no owner' => [
Expand Down Expand Up @@ -421,7 +421,7 @@ public function testCanPermissions(string $linkPermission, string $ownerPermissi
$this->assertFalse($link->can($permissionName));
}

public function provideCanPermissions()
public static function provideCanPermissions()
{
return [
'canView' => [
Expand All @@ -447,7 +447,7 @@ public function testCanCreate()
$this->assertTrue($link->can('Create'));
}

public function provideLinkType(): array
public static function provideLinkType(): array
{
return [
'email_link_type' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/php/Services/LinkTypeServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function testGenerateAllLinkTypes()
$this->assertSame($expected, $types);
}

public function keyClassDataProvider(): array
public static function keyClassDataProvider(): array
{
return [
'sitetree_key' => [
Expand Down
8 changes: 4 additions & 4 deletions tests/php/Traits/AllowedLinkClassesTraitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function testSetAllowedTypes(array $enabled, array $expected)
$this->assertEquals($expected, $result);
}

public function allowedTypesDataProvider() : array
public static function allowedTypesDataProvider() : array
{
return [
'allow all Link classes' => [
Expand Down Expand Up @@ -91,7 +91,7 @@ public function testSetAllowedTypesException(array $enabled)
$trait->setAllowedTypes($enabled);
}

public function provideTypesExceptionDataProvider() : array
public static function provideTypesExceptionDataProvider() : array
{
return [
'allow all with empty array' => [
Expand All @@ -106,7 +106,7 @@ public function provideTypesExceptionDataProvider() : array
];
}

public function sortedTypesDataProvider() : array
public static function sortedTypesDataProvider() : array
{
return [
'sort all allowed Link classes' => [
Expand Down Expand Up @@ -199,7 +199,7 @@ public function testGetTypesPropCanCreate(): void
$this->assertFalse($json['testphone']['allowed']);
}

public function provideGetTypesProp() : array
public static function provideGetTypesProp() : array
{
return [
'SiteTreeLink props' => [
Expand Down

0 comments on commit bd65d5e

Please sign in to comment.