DEP Use PHPUnit 11

This commit is contained in:
Steve Boyd 2024-09-10 11:27:33 +12:00
parent fee08b13c0
commit a3b96bab57
3 changed files with 9 additions and 13 deletions

View File

@ -20,7 +20,7 @@
"silverstripe/cms": "^6"
},
"require-dev": {
"phpunit/phpunit": "^9.6",
"phpunit/phpunit": "^11.3",
"squizlabs/php_codesniffer": "^3",
"symbiote/silverstripe-queuedjobs": "^6",
"silverstripe/standards": "^1",

View File

@ -13,6 +13,7 @@ use SilverStripe\ExternalLinks\Tests\Stubs\ExternalLinksTestPage;
use SilverStripe\ExternalLinks\Tests\Stubs\PretendLinkChecker;
use SilverStripe\i18n\i18n;
use SilverStripe\Reports\Report;
use PHPUnit\Framework\Attributes\DataProvider;
class ExternalLinksTest extends FunctionalTest
{
@ -127,7 +128,7 @@ class ExternalLinksTest extends FunctionalTest
$this->assertEquals(3, BrokenExternalLinksReport::create()->sourceRecords()->count());
}
public function provideGetJobStatus(): array
public static function provideGetJobStatus(): array
{
return [
'ADMIN - valid permission' => ['ADMIN', 200],
@ -136,9 +137,7 @@ class ExternalLinksTest extends FunctionalTest
];
}
/**
* @dataProvider provideGetJobStatus
*/
#[DataProvider('provideGetJobStatus')]
public function testGetJobStatus(
string $permission,
int $expectedResponseCode

View File

@ -4,12 +4,11 @@ namespace SilverStripe\ExternalLinks\Tests\Model;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\ExternalLinks\Model\BrokenExternalLink;
use PHPUnit\Framework\Attributes\DataProvider;
class BrokenExternalLinkTest extends SapphireTest
{
/**
* @dataProvider httpCodeProvider
*/
#[DataProvider('httpCodeProvider')]
public function testGetHTTPCodeDescription(int $httpCode, string $expected)
{
$link = new BrokenExternalLink();
@ -17,7 +16,7 @@ class BrokenExternalLinkTest extends SapphireTest
$this->assertSame($expected, $link->getHTTPCodeDescription());
}
public function httpCodeProvider(): array
public static function httpCodeProvider(): array
{
return [
[200, '200 (OK)'],
@ -28,7 +27,7 @@ class BrokenExternalLinkTest extends SapphireTest
];
}
public function permissionProvider(): array
public static function permissionProvider(): array
{
return [
['admin', 'ADMIN'],
@ -37,9 +36,7 @@ class BrokenExternalLinkTest extends SapphireTest
];
}
/**
* @dataProvider permissionProvider
*/
#[DataProvider('permissionProvider')]
public function testCanViewReport(string $user, string $permission)
{
$this->logOut();