DEP Use PHPUnit 11

This commit is contained in:
Steve Boyd 2024-09-10 16:55:15 +12:00
parent 7ff96048cb
commit 1a03cb53cd
2 changed files with 5 additions and 11 deletions

View File

@ -7,9 +7,6 @@ use SilverStripe\Dev\SapphireTest;
use SilverStripe\ORM\FieldType\DBDatetime; use SilverStripe\ORM\FieldType\DBDatetime;
use SilverStripe\Security\Security; use SilverStripe\Security\Security;
/**
* @coversDefaultClass \SilverStripe\Blog\Model\BlogPostFilter
*/
class BlogPostFilterTest extends SapphireTest class BlogPostFilterTest extends SapphireTest
{ {
/** /**
@ -33,7 +30,6 @@ class BlogPostFilterTest extends SapphireTest
/** /**
* Tests that unpublished articles are not returned * Tests that unpublished articles are not returned
* @covers ::augmentSQL
*/ */
public function testFilter() public function testFilter()
{ {

View File

@ -10,6 +10,7 @@ use SilverStripe\ORM\FieldType\DBDatetime;
use SilverStripe\Security\Member; use SilverStripe\Security\Member;
use SilverStripe\Security\Security; use SilverStripe\Security\Security;
use SilverStripe\Versioned\Versioned; use SilverStripe\Versioned\Versioned;
use PHPUnit\Framework\Attributes\DataProvider;
class BlogPostTest extends SapphireTest class BlogPostTest extends SapphireTest
{ {
@ -21,9 +22,7 @@ class BlogPostTest extends SapphireTest
parent::tearDown(); parent::tearDown();
} }
/** #[DataProvider('canViewProvider')]
* @dataProvider canViewProvider
*/
public function testCanView($date, $user, $page, $canView, $stage) public function testCanView($date, $user, $page, $canView, $stage)
{ {
$userRecord = $this->objFromFixture(Member::class, $user); $userRecord = $this->objFromFixture(Member::class, $user);
@ -45,7 +44,7 @@ class BlogPostTest extends SapphireTest
* - expected result * - expected result
* - versioned stage * - versioned stage
*/ */
public function canViewProvider() public static function canViewProvider()
{ {
$someFutureDate = '2013-10-10 20:00:00'; $someFutureDate = '2013-10-10 20:00:00';
$somePastDate = '2009-10-10 20:00:00'; $somePastDate = '2009-10-10 20:00:00';
@ -152,9 +151,8 @@ class BlogPostTest extends SapphireTest
/** /**
* @param string $type * @param string $type
* @param string $expected * @param string $expected
* @dataProvider monthlyArchiveLinkProvider
* @group wip
*/ */
#[DataProvider('monthlyArchiveLinkProvider')]
public function testGetMonthlyArchiveLink($type, $expected) public function testGetMonthlyArchiveLink($type, $expected)
{ {
/** @var BlogPost $blogPost */ /** @var BlogPost $blogPost */
@ -168,7 +166,7 @@ class BlogPostTest extends SapphireTest
/** /**
* @return array[] * @return array[]
*/ */
public function monthlyArchiveLinkProvider() public static function monthlyArchiveLinkProvider()
{ {
return [ return [
['day', '/2013/10/1'], ['day', '/2013/10/1'],