2009-05-06 00:12:38 +02:00
|
|
|
<?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';
|
|
|
|
|
2009-05-06 02:13:52 +02:00
|
|
|
public static $managed_models = array(
|
2009-05-06 00:12:38 +02:00
|
|
|
'ModelAdminTest_Contact',
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
class ModelAdminTest_Contact extends DataObject {
|
|
|
|
static $db = array(
|
|
|
|
"Name" => "Varchar",
|
|
|
|
"Phone" => "Varchar",
|
|
|
|
);
|
|
|
|
}
|