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 7eb74af commit 69df2f5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions tests/BaseElementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public function testUpdateContentForSearchIndex()
ElementContent::remove_extension(TestContentForSearchIndexExtension::class);
}

public function getElementAnchorDataProvider(): array
public static function getElementAnchorDataProvider(): array
{
return [
[
Expand Down Expand Up @@ -307,7 +307,7 @@ public function testGetAnchorsInContent(string $elementClass, string $elementNam
$this->assertSame($expectedAnchors, array_values($element->getAnchorsInContent()));
}

public function getElementCMSLinkDataProvider()
public static function getElementCMSLinkDataProvider()
{
return [
// Element in DataObject with $directLink === true
Expand Down Expand Up @@ -366,7 +366,7 @@ public function testGetCMSEditLink(string $class, string $element, ?string $link
}
}

public function canDeleteProvider()
public static function canDeleteProvider()
{
return [
// Element on Page
Expand Down Expand Up @@ -400,7 +400,7 @@ public function testCanDelete(
$this->assertTrue($canDelete);
}

public function linksProvider()
public static function linksProvider()
{
return [
// Element on Page
Expand Down Expand Up @@ -438,7 +438,7 @@ public function testAbsoluteLink(string $class, string $element, ?string $link)
$this->assertEquals($link, $absoluteLink);
}

public function previewLinksProvider()
public static function previewLinksProvider()
{
return [
// Element on Page
Expand Down
4 changes: 2 additions & 2 deletions tests/Controllers/ElementSiteTreeFilterSearchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function testElementalPageDataMatchesInCmsSearch($searchTerm, $expected)
/**
* @return array[]
*/
public function searchProvider()
public static function searchProvider()
{
return [
'Nested block data' => ['specifically', [
Expand Down Expand Up @@ -78,7 +78,7 @@ public function testApplyDefaultFilters(bool $renderElements, string $term, arra
$this->assertSame($expected, $ret->column('Title'));
}

public function provideApplyDefaultFilters(): array
public static function provideApplyDefaultFilters(): array
{

return [
Expand Down
20 changes: 10 additions & 10 deletions tests/Controllers/ElementalAreaControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ protected function tearDown(): void
}
}

public function provideElementFormGetSchema(): array
public static function provideElementFormGetSchema(): array
{
// There specifically isn't an 'invalid / missing' record test here with $idType, as existing behaviour
// is to return a 200 with a basically empty schema response.
Expand Down Expand Up @@ -89,7 +89,7 @@ public function testElementFormGetSchema(
$this->assertFalse(array_key_exists('errors', $formSchema));
}

public function provideElementFormPost(): array
public static function provideElementFormPost(): array
{
return [
'Valid update existing record' => [
Expand Down Expand Up @@ -232,7 +232,7 @@ public function testElementFormPost(string $idType, string $dataType, string $fa
}
}

public function provideElementFormReadonly(): array
public static function provideElementFormReadonly(): array
{
return [
'Can edit' => [
Expand Down Expand Up @@ -262,7 +262,7 @@ public function testElementFormReadonly(string $fail, bool $expected): void
$this->assertSame($expected, $actual);
}

public function provideApiDelete(): array
public static function provideApiDelete(): array
{
return [
'Valid' => [
Expand Down Expand Up @@ -330,7 +330,7 @@ public function testApiDelete(
}
}

public function provideApiCreate(): array
public static function provideApiCreate(): array
{
return [
'Valid' => [
Expand Down Expand Up @@ -449,7 +449,7 @@ public function testApiCreate(
$this->assertSame($expected, $map);
}

public function provideApiDuplicate(): array
public static function provideApiDuplicate(): array
{
return [
'Valid' => [
Expand Down Expand Up @@ -547,7 +547,7 @@ public function testApiDuplicate(
}
}

public function provideApiPublish(): array
public static function provideApiPublish(): array
{
return [
'Valid' => [
Expand Down Expand Up @@ -627,7 +627,7 @@ public function testApiPublish(
}
}

public function provideApiRead(): array
public static function provideApiRead(): array
{
return [
'Valid' => [
Expand Down Expand Up @@ -762,7 +762,7 @@ public function testApiRead(
}
}

public function provideApiSort(): array
public static function provideApiSort(): array
{
return [
'Valid move from first' => [
Expand Down Expand Up @@ -866,7 +866,7 @@ public function testApiSort(
$this->assertSame($expected, $map);
}

public function provideApiUnpublish(): array
public static function provideApiUnpublish(): array
{
return [
'Valid' => [
Expand Down
2 changes: 1 addition & 1 deletion tests/Extensions/ElementalAreasExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function testContentFieldsAreRemovedByDefault($keepGlobal, $keepClass, $e
*
* @return array
*/
public function provideContentFieldPreservationSettings()
public static function provideContentFieldPreservationSettings()
{
// Test both unset (null) and explicitly declined (false) where applicable.
return [
Expand Down
4 changes: 2 additions & 2 deletions tests/TopPage/TopPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function testNewBlock(bool $populateTopPage): void
$this->assertEquals((int) $page->ID, (int) $content->TopPageID);
}

public function objectsProvider(): array
public static function objectsProvider(): array
{
return [
[
Expand Down Expand Up @@ -204,7 +204,7 @@ public function objectsProvider(): array
];
}

public function populateTopPageProvider(): array
public static function populateTopPageProvider(): array
{
return [
[true],
Expand Down

0 comments on commit 69df2f5

Please sign in to comment.