This commit is contained in:
Daniel Hensby 2021-05-14 10:42:45 +01:00
parent ebcfc483be
commit c89a759af6
No known key found for this signature in database
GPG Key ID: D8DEBC4C8E7BC8B9

View File

@ -10,6 +10,7 @@ use SilverStripe\ContentReview\Extensions\ContentReviewDefaultSettings;
use SilverStripe\ContentReview\Extensions\ContentReviewOwner;
use SilverStripe\ContentReview\Extensions\SiteTreeContentReview;
use SilverStripe\Forms\LiteralField;
use SilverStripe\ORM\FieldType\DBDate;
use SilverStripe\ORM\FieldType\DBDatetime;
use SilverStripe\Security\Group;
use SilverStripe\Security\Member;
@ -123,6 +124,20 @@ class SiteTreeContentReviewTest extends ContentReviewBaseTest
$this->assertEquals(null, $page->NextReviewDate);
}
public function testAdvanceReviewDate()
{
$page = new Page();
$page->Title = 'Test page';
$page->ReviewPeriodDays = 0;
// Set timestamp to a time in the past
$timestamp = DBDatetime::now()->getTimestamp() - 100000;
$page->NextReviewDate = DBDate::create()->setValue($timestamp)->Format(DBDate::ISO_DATE);
$page->write();
$page->advanceReviewDate();
$this->assertNull(Page::get()->find('Title', 'Test page')->NextReviewDate);
}
public function testAddReviewNote()
{
/** @var Member $author */