Skip to content

Commit

Permalink
Merge pull request #329 from creative-commoners/pulls/3/phpunit11
Browse files Browse the repository at this point in the history
DEP Use PHPUnit 11
  • Loading branch information
GuySartorelli authored Sep 18, 2024
2 parents 119a5a4 + 5ed81ad commit 6b703d7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"silverstripe/vendor-plugin": "^2"
},
"require-dev": {
"phpunit/phpunit": "^9.6",
"phpunit/phpunit": "^11.3",
"squizlabs/php_codesniffer": "^3.7",
"silverstripe/asset-admin": "^3",
"silverstripe/cms": "^6",
Expand Down
13 changes: 5 additions & 8 deletions tests/php/CampaignAdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use SilverStripe\Security\Permission;
use SilverStripe\Versioned\ChangeSet;
use SilverStripe\Versioned\ChangeSetItem;
use PHPUnit\Framework\Attributes\DataProvider;

class CampaignAdminTest extends FunctionalTest
{
Expand Down Expand Up @@ -137,7 +138,7 @@ public function testFilters()
);
}

public function readCampaignDataProvider()
public static function readCampaignDataProvider()
{
return [
'valid campaign' => ['change1', 'CMS_ACCESS_CampaignAdmin', 200],
Expand All @@ -147,9 +148,7 @@ public function readCampaignDataProvider()
];
}

/**
* @dataProvider readCampaignDataProvider
*/
#[DataProvider('readCampaignDataProvider')]
public function testReadCampaign(
string $changesetName,
string $permission,
Expand All @@ -162,7 +161,7 @@ public function testReadCampaign(
$this->assertEquals($expectedResponseCode, $response->getStatusCode());
}

public function provideRemoveCampaignItem(): array
public static function provideRemoveCampaignItem(): array
{
return [
'open campaign' => [false, false, 204],
Expand All @@ -171,9 +170,7 @@ public function provideRemoveCampaignItem(): array
];
}

/**
* @dataProvider provideRemoveCampaignItem
*/
#[DataProvider('provideRemoveCampaignItem')]
public function testRemoveCampaignItem(
bool $isPublished,
bool $isWrongID,
Expand Down

0 comments on commit 6b703d7

Please sign in to comment.