From 1a03cb53cd2f49da53105ccd1137a2146696a662 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 10 Sep 2024 16:55:15 +1200 Subject: [PATCH] DEP Use PHPUnit 11 --- tests/php/BlogPostFilterTest.php | 4 ---- tests/php/BlogPostTest.php | 12 +++++------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/tests/php/BlogPostFilterTest.php b/tests/php/BlogPostFilterTest.php index 2b45fbe1..2bb7e404 100755 --- a/tests/php/BlogPostFilterTest.php +++ b/tests/php/BlogPostFilterTest.php @@ -7,9 +7,6 @@ use SilverStripe\ORM\FieldType\DBDatetime; use SilverStripe\Security\Security; -/** - * @coversDefaultClass \SilverStripe\Blog\Model\BlogPostFilter - */ class BlogPostFilterTest extends SapphireTest { /** @@ -33,7 +30,6 @@ protected function tearDown(): void /** * Tests that unpublished articles are not returned - * @covers ::augmentSQL */ public function testFilter() { diff --git a/tests/php/BlogPostTest.php b/tests/php/BlogPostTest.php index 51abc217..86bf1180 100644 --- a/tests/php/BlogPostTest.php +++ b/tests/php/BlogPostTest.php @@ -10,6 +10,7 @@ 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 @@ protected function tearDown(): void parent::tearDown(); } - /** - * @dataProvider canViewProvider - */ + #[DataProvider('canViewProvider')] public function testCanView($date, $user, $page, $canView, $stage) { $userRecord = $this->objFromFixture(Member::class, $user); @@ -45,7 +44,7 @@ public function testCanView($date, $user, $page, $canView, $stage) * - 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 @@ public function testMinutesToRead() /** * @param string $type * @param string $expected - * @dataProvider monthlyArchiveLinkProvider - * @group wip */ + #[DataProvider('monthlyArchiveLinkProvider')] public function testGetMonthlyArchiveLink($type, $expected) { /** @var BlogPost $blogPost */ @@ -168,7 +166,7 @@ public function testGetMonthlyArchiveLink($type, $expected) /** * @return array[] */ - public function monthlyArchiveLinkProvider() + public static function monthlyArchiveLinkProvider() { return [ ['day', '/2013/10/1'],