class SubsiteAdminTest extends SapphireTest { static $fixture_file = 'subsites/tests/SubsiteTest.yml'; function adminLoggedInSession() { return new Session(array( 'loggedInAs' => $this->idFromFixture('Member', 'admin') )); } /** * Test generation of the view */ function testBasicView() { // Open the admin area logged in as admin $response1 = Director::test('admin/subsites/', null, $this->adminLoggedInSession()); // Confirm that this URL gets you the entire page, with the edit form loaded $response2 = Director::test('admin/subsites/show/1', null, $this->adminLoggedInSession()); $this->assertTrue(strpos($response2->getBody(), 'id="Root_Configuration"') !== false); $this->assertTrue(strpos($response2->getBody(), '
1), $this->adminLoggedInSession()); $this->assertTrue(strpos($response3->getBody(), 'id="Root_Configuration"') !== false); $this->assertTrue(strpos($response3->getBody(), '