Skip to content

Commit

Permalink
DEP Use PHPUnit 11
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Sep 10, 2024
1 parent b186a32 commit b04a075
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
1 change: 0 additions & 1 deletion tests/php/BlogPostFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ protected function tearDown(): void

/**
* Tests that unpublished articles are not returned
* @covers ::augmentSQL
*/
public function testFilter()
{
Expand Down
12 changes: 5 additions & 7 deletions tests/php/BlogPostTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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);
Expand All @@ -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';
Expand Down Expand Up @@ -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 */
Expand All @@ -168,7 +166,7 @@ public function testGetMonthlyArchiveLink($type, $expected)
/**
* @return array[]
*/
public function monthlyArchiveLinkProvider()
public static function monthlyArchiveLinkProvider()
{
return [
['day', '/2013/10/1'],
Expand Down

0 comments on commit b04a075

Please sign in to comment.