silverstripe-cms/tests/ModelAdminTest.php
Sam Minnee b2aa86140a API CHANGE: Made ModelAdmin's configuration statics public rather than protected, so that they can be accessed with Object::get_static()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/branches/2.3@76124 467b73ca-7a2a-4603-9d3b-597d59a354a9
2011-02-02 17:48:19 +13:00

27 lines
638 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 {
static $url_segment = 'testadmin';
public static $managed_models = array(
'ModelAdminTest_Contact',
);
}
class ModelAdminTest_Contact extends DataObject {
static $db = array(
"Name" => "Varchar",
"Phone" => "Varchar",
);
}