Group tests together in the same test class #3

This commit is contained in:
Stig Lindqvist 2014-02-25 00:50:52 +13:00 committed by Stig Lindqvist
parent de4fac0541
commit c021af834b
3 changed files with 21 additions and 18 deletions

3
.gitconfig Normal file
View File

@ -0,0 +1,3 @@
[user]
name = Stig Lindqvist
email = stojg.lindqvist@gmail.com

View File

@ -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());

View File

@ -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');