mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
25 lines
546 B
PHP
Executable File
25 lines
546 B
PHP
Executable File
<?php
|
|
|
|
class BlogPostFilterTest extends SapphireTest {
|
|
|
|
static $fixture_file = "blog.yml";
|
|
|
|
public function setUp() {
|
|
SS_Datetime::set_mock_now("2013-10-10 20:00:00");
|
|
parent::setUp();
|
|
}
|
|
|
|
public function testFilter() {
|
|
$member = Member::currentUser();
|
|
if($member) $member->logout();
|
|
|
|
$count = BlogPost::get()->count();
|
|
$this->assertEquals(3, $count, "Filtered blog posts");
|
|
|
|
SS_Datetime::set_mock_now("2020-01-01 00:00:00");
|
|
$count = BlogPost::get()->count();
|
|
$this->assertEquals(5, $count, "Unfiltered blog posts");
|
|
}
|
|
|
|
}
|