BUGFIX Fixed SiteTreeActionsTest to use unconditional class defintion - was failing due to recent changes in ClassInfo and class_exists()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@83969 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2009-08-06 21:39:04 +00:00
parent 26d7985877
commit 9ae437e577

View File

@ -12,16 +12,13 @@
* @package sapphire * @package sapphire
* @subpackage tests * @subpackage tests
*/ */
if(class_exists('SiteTreeCMSWorkflow')) { class SiteTreeActionsTest extends FunctionalTest {
class SiteTreeActionsTest extends FunctionalTest {
function testDummy() {}
}
} else {
class SiteTreeActionsTest extends FunctionalTest {
static $fixture_file = 'sapphire/tests/SiteTreeActionsTest.yml'; static $fixture_file = 'sapphire/tests/SiteTreeActionsTest.yml';
function testActionsNewPage() { function testActionsNewPage() {
if(class_exists('SiteTreeCMSWorkflow')) return true;
$className = 'Page'; $className = 'Page';
$page = new $className(); $page = new $className();
$page->Title = 'New ' . $className; $page->Title = 'New ' . $className;
@ -45,6 +42,8 @@ if(class_exists('SiteTreeCMSWorkflow')) {
} }
function testActionsPublishedRecord() { function testActionsPublishedRecord() {
if(class_exists('SiteTreeCMSWorkflow')) return true;
$page = new Page(); $page = new Page();
$page->write(); $page->write();
$page->publish('Stage', 'Live'); $page->publish('Stage', 'Live');
@ -64,6 +63,8 @@ if(class_exists('SiteTreeCMSWorkflow')) {
} }
function testActionsDeletedFromStageRecord() { function testActionsDeletedFromStageRecord() {
if(class_exists('SiteTreeCMSWorkflow')) return true;
$page = new Page(); $page = new Page();
$page->write(); $page->write();
$pageID = $page->ID; $pageID = $page->ID;
@ -88,6 +89,8 @@ if(class_exists('SiteTreeCMSWorkflow')) {
} }
function testActionsChangedOnStageRecord() { function testActionsChangedOnStageRecord() {
if(class_exists('SiteTreeCMSWorkflow')) return true;
$page = new Page(); $page = new Page();
$page->write(); $page->write();
$page->publish('Stage', 'Live'); $page->publish('Stage', 'Live');
@ -108,6 +111,5 @@ if(class_exists('SiteTreeCMSWorkflow')) {
$this->assertContains('action_rollback',$actionsArr); $this->assertContains('action_rollback',$actionsArr);
$this->assertNotContains('action_revert',$actionsArr); $this->assertNotContains('action_revert',$actionsArr);
} }
}
} }
?> ?>