Skip to content

Commit

Permalink
Merge pull request #784 from creative-commoners/pulls/5/phpunit11
Browse files Browse the repository at this point in the history
DEP Use PHPUnit 11
  • Loading branch information
GuySartorelli authored Sep 18, 2024
2 parents 7ff9604 + 1a03cb5 commit d994acf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
4 changes: 0 additions & 4 deletions tests/php/BlogPostFilterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
use SilverStripe\ORM\FieldType\DBDatetime;
use SilverStripe\Security\Security;

/**
* @coversDefaultClass \SilverStripe\Blog\Model\BlogPostFilter
*/
class BlogPostFilterTest extends SapphireTest
{
/**
Expand All @@ -33,7 +30,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 d994acf

Please sign in to comment.