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\Security\Security;
/**
* @coversDefaultClass \SilverStripe\Blog\Model\BlogPostFilter
*/
class BlogPostFilterTest extends SapphireTest
{
/**
@ -33,7 +30,6 @@ class BlogPostFilterTest extends SapphireTest
/**
* Tests that unpublished articles are not returned
* @covers ::augmentSQL
*/
public function testFilter()
{

View File

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