diff --git a/tests/LeftAndMainTest.php b/tests/LeftAndMainTest.php index 4997d731..d5b3a527 100644 --- a/tests/LeftAndMainTest.php +++ b/tests/LeftAndMainTest.php @@ -11,6 +11,7 @@ class LeftAndMainTest extends FunctionalTest { // @todo fix controller stack problems and re-activate //$this->autoFollowRedirection = false; + CMSMenu::populate_menu(); } /** diff --git a/tests/ModelAdminTest.php b/tests/ModelAdminTest.php new file mode 100644 index 00000000..a5ae5252 --- /dev/null +++ b/tests/ModelAdminTest.php @@ -0,0 +1,29 @@ +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", + ); +} \ No newline at end of file diff --git a/tests/ModelAdminTest.yml b/tests/ModelAdminTest.yml new file mode 100644 index 00000000..1a1758b5 --- /dev/null +++ b/tests/ModelAdminTest.yml @@ -0,0 +1,19 @@ +ModelAdminTest_Contact: + sam: + Name: Sam + Phone: 021 123 456 + ingo: + Name: ingo + Phone: 04 987 6543 + +Member: + admin: + FirstName: admin +Group: + admin: + Title: Admin + Members: =>Member.admin +Permission: + admin: + Code: ADMIN + Group: =>Group.admin \ No newline at end of file