mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
DEP Use PHPUnit 11
This commit is contained in:
parent
7ff96048cb
commit
1a03cb53cd
@ -7,9 +7,6 @@ use SilverStripe\Dev\SapphireTest;
|
|||||||
use SilverStripe\ORM\FieldType\DBDatetime;
|
use SilverStripe\ORM\FieldType\DBDatetime;
|
||||||
use SilverStripe\Security\Security;
|
use SilverStripe\Security\Security;
|
||||||
|
|
||||||
/**
|
|
||||||
* @coversDefaultClass \SilverStripe\Blog\Model\BlogPostFilter
|
|
||||||
*/
|
|
||||||
class BlogPostFilterTest extends SapphireTest
|
class BlogPostFilterTest extends SapphireTest
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -33,7 +30,6 @@ class BlogPostFilterTest extends SapphireTest
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Tests that unpublished articles are not returned
|
* Tests that unpublished articles are not returned
|
||||||
* @covers ::augmentSQL
|
|
||||||
*/
|
*/
|
||||||
public function testFilter()
|
public function testFilter()
|
||||||
{
|
{
|
||||||
|
@ -10,6 +10,7 @@ use SilverStripe\ORM\FieldType\DBDatetime;
|
|||||||
use SilverStripe\Security\Member;
|
use SilverStripe\Security\Member;
|
||||||
use SilverStripe\Security\Security;
|
use SilverStripe\Security\Security;
|
||||||
use SilverStripe\Versioned\Versioned;
|
use SilverStripe\Versioned\Versioned;
|
||||||
|
use PHPUnit\Framework\Attributes\DataProvider;
|
||||||
|
|
||||||
class BlogPostTest extends SapphireTest
|
class BlogPostTest extends SapphireTest
|
||||||
{
|
{
|
||||||
@ -21,9 +22,7 @@ class BlogPostTest extends SapphireTest
|
|||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
#[DataProvider('canViewProvider')]
|
||||||
* @dataProvider canViewProvider
|
|
||||||
*/
|
|
||||||
public function testCanView($date, $user, $page, $canView, $stage)
|
public function testCanView($date, $user, $page, $canView, $stage)
|
||||||
{
|
{
|
||||||
$userRecord = $this->objFromFixture(Member::class, $user);
|
$userRecord = $this->objFromFixture(Member::class, $user);
|
||||||
@ -45,7 +44,7 @@ class BlogPostTest extends SapphireTest
|
|||||||
* - expected result
|
* - expected result
|
||||||
* - versioned stage
|
* - versioned stage
|
||||||
*/
|
*/
|
||||||
public function canViewProvider()
|
public static function canViewProvider()
|
||||||
{
|
{
|
||||||
$someFutureDate = '2013-10-10 20:00:00';
|
$someFutureDate = '2013-10-10 20:00:00';
|
||||||
$somePastDate = '2009-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 $type
|
||||||
* @param string $expected
|
* @param string $expected
|
||||||
* @dataProvider monthlyArchiveLinkProvider
|
|
||||||
* @group wip
|
|
||||||
*/
|
*/
|
||||||
|
#[DataProvider('monthlyArchiveLinkProvider')]
|
||||||
public function testGetMonthlyArchiveLink($type, $expected)
|
public function testGetMonthlyArchiveLink($type, $expected)
|
||||||
{
|
{
|
||||||
/** @var BlogPost $blogPost */
|
/** @var BlogPost $blogPost */
|
||||||
@ -168,7 +166,7 @@ class BlogPostTest extends SapphireTest
|
|||||||
/**
|
/**
|
||||||
* @return array[]
|
* @return array[]
|
||||||
*/
|
*/
|
||||||
public function monthlyArchiveLinkProvider()
|
public static function monthlyArchiveLinkProvider()
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
['day', '/2013/10/1'],
|
['day', '/2013/10/1'],
|
||||||
|
Loading…
Reference in New Issue
Block a user