silverstripe-cms/tests/ModelAdminTest.php
Ingo Schommer 45772748d3 BUGFIX Implementing TestOnly interface in ModelAdminTest to avoid having it included automatically in CMSMenu and hence breaking other tests like LeftAndMainTest.
ENHANCEMENT Filtering out TestOnly classes in CMSMenu::get_cms_classes()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@85281 467b73ca-7a2a-4603-9d3b-597d59a354a9
2009-08-26 21:10:58 +00:00

27 lines
658 B
PHP

<?php
class ModelAdminTest extends FunctionalTest {
static $fixture_file = 'cms/tests/ModelAdminTest.yml';
function testModelAdminOpens() {
$this->autoFollowRedirection = false;
$this->logInAs('admin');
$this->assertTrue((bool)Permission::check("ADMIN"));
$this->assertEquals(200, $this->get('ModelAdminTest_Admin')->getStatusCode());
}
}
class ModelAdminTest_Admin extends ModelAdmin implements TestOnly {
static $url_segment = 'testadmin';
public static $managed_models = array(
'ModelAdminTest_Contact',
);
}
class ModelAdminTest_Contact extends DataObject {
static $db = array(
"Name" => "Varchar",
"Phone" => "Varchar",
);
}