mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
29 lines
709 B
PHP
29 lines
709 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"));
|
||
|
|
||
|
Debug::message($this->get('ModelAdminTest_Admin')->getBody());
|
||
|
$this->assertEquals(200, $this->get('ModelAdminTest_Admin')->getStatusCode());
|
||
|
}
|
||
|
}
|
||
|
|
||
|
class ModelAdminTest_Admin extends ModelAdmin {
|
||
|
static $url_segment = 'testadmin';
|
||
|
|
||
|
protected static $managed_models = array(
|
||
|
'ModelAdminTest_Contact',
|
||
|
);
|
||
|
}
|
||
|
|
||
|
class ModelAdminTest_Contact extends DataObject {
|
||
|
static $db = array(
|
||
|
"Name" => "Varchar",
|
||
|
"Phone" => "Varchar",
|
||
|
);
|
||
|
}
|