Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DEP Use PHPUnit 11 #784

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading