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

DEP Use PHPUnit 11 #329

Merged
merged 1 commit into from
Sep 18, 2024
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
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
Loading