mirror of
https://github.com/silverstripe/silverstripe-contentreview
synced 2024-10-22 17:05:47 +02:00
Group tests together in the same test class #3
This commit is contained in:
parent
de4fac0541
commit
c021af834b
3
.gitconfig
Normal file
3
.gitconfig
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
[user]
|
||||||
|
name = Stig Lindqvist
|
||||||
|
email = stojg.lindqvist@gmail.com
|
@ -7,6 +7,24 @@ class ContentReviewSettingsTest extends SapphireTest {
|
|||||||
|
|
||||||
public static $fixture_file = 'contentreview/tests/ContentReviewSettingsTest.yml';
|
public static $fixture_file = 'contentreview/tests/ContentReviewSettingsTest.yml';
|
||||||
|
|
||||||
|
public function testAdvanceReviewDate10Days() {
|
||||||
|
$page = new Page();
|
||||||
|
$page->ContentReviewType = 'Custom';
|
||||||
|
$page->ReviewPeriodDays = 10;
|
||||||
|
$this->assertTrue($page->advanceReviewDate());
|
||||||
|
$page->write();
|
||||||
|
$this->assertEquals(date('Y-m-d', strtotime('now + 10 days')), $page->NextReviewDate);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testAdvanceReviewDateNull() {
|
||||||
|
$page = new Page();
|
||||||
|
$page->ContentReviewType = 'Custom';
|
||||||
|
$page->ReviewPeriodDays = 0;
|
||||||
|
$this->assertFalse($page->advanceReviewDate());
|
||||||
|
$page->write();
|
||||||
|
$this->assertEquals(null, $page->NextReviewDate);
|
||||||
|
}
|
||||||
|
|
||||||
public function testAdvanceReviewFromCustomSettings() {
|
public function testAdvanceReviewFromCustomSettings() {
|
||||||
$page = $this->objFromFixture('Page', 'custom');
|
$page = $this->objFromFixture('Page', 'custom');
|
||||||
$this->assertTrue($page->advanceReviewDate());
|
$this->assertTrue($page->advanceReviewDate());
|
||||||
|
@ -36,24 +36,6 @@ class SiteTreeContentReviewTest extends FunctionalTest {
|
|||||||
$this->assertEquals(null, $page->NextReviewDate);
|
$this->assertEquals(null, $page->NextReviewDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAdvanceReviewDate10Days() {
|
|
||||||
$page = new Page();
|
|
||||||
$page->ContentReviewType = 'Custom';
|
|
||||||
$page->ReviewPeriodDays = 10;
|
|
||||||
$this->assertTrue($page->advanceReviewDate());
|
|
||||||
$page->write();
|
|
||||||
$this->assertEquals(date('Y-m-d', strtotime('now + 10 days')), $page->NextReviewDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testAdvanceReviewDateNull() {
|
|
||||||
$page = new Page();
|
|
||||||
$page->ContentReviewType = 'Custom';
|
|
||||||
$page->ReviewPeriodDays = 0;
|
|
||||||
$this->assertFalse($page->advanceReviewDate());
|
|
||||||
$page->write();
|
|
||||||
$this->assertEquals(null, $page->NextReviewDate);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function testAddReviewNote() {
|
public function testAddReviewNote() {
|
||||||
$author = $this->objFromFixture('Member', 'author');
|
$author = $this->objFromFixture('Member', 'author');
|
||||||
$page = $this->objFromFixture('Page', 'home');
|
$page = $this->objFromFixture('Page', 'home');
|
||||||
|
Loading…
Reference in New Issue
Block a user