silverstripe-reports/tests/ModelAdminTest.php
Ingo Schommer fc71d16100 MINOR: Updated ModelAdminTest to use extraDataObjects (from r90055) (from r96803)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@102666 467b73ca-7a2a-4603-9d3b-597d59a354a9
2010-04-13 03:27:47 +00:00

32 lines
776 B
PHP

<?php
class ModelAdminTest extends FunctionalTest {
static $fixture_file = 'cms/tests/ModelAdminTest.yml';
protected $extraDataObjects = array(
'ModelAdminTest_Admin',
'ModelAdminTest_Contact',
);
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 implements TestOnly {
static $db = array(
"Name" => "Varchar",
"Phone" => "Varchar",
);
}