MINOR: Updated SiteTreePermissionsTest to use RelativeLink() to generate links for testing.

From: Andrew Short <andrewjshort@gmail.com>

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@88500 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew Short 2009-10-11 00:07:20 +00:00 committed by Sam Minnee
parent beebf785b5
commit add7e803dd

14
tests/SiteTreePermissionsTest.php Normal file → Executable file
View File

@ -69,7 +69,7 @@ class SiteTreePermissionsTest extends FunctionalTest {
'Unauthenticated members cant view a page marked as "Viewable for any logged in users"'
);
$this->session()->inst_set('loggedInAs', null);
$response = $this->get($page->URLSegment);
$response = $this->get($page->RelativeLink());
$this->assertEquals(
$response->getStatusCode(),
302,
@ -83,7 +83,7 @@ class SiteTreePermissionsTest extends FunctionalTest {
'Authenticated members can view a page marked as "Viewable for any logged in users" even if they dont have access to the CMS'
);
$this->session()->inst_set('loggedInAs', $websiteuser->ID);
$response = $this->get($page->URLSegment);
$response = $this->get($page->RelativeLink());
$this->assertEquals(
$response->getStatusCode(),
200,
@ -101,7 +101,7 @@ class SiteTreePermissionsTest extends FunctionalTest {
'Unauthenticated members cant view a page marked as "Viewable by these groups"'
);
$this->session()->inst_set('loggedInAs', null);
$response = $this->get($page->URLSegment);
$response = $this->get($page->RelativeLink());
$this->assertEquals(
$response->getStatusCode(),
302,
@ -115,7 +115,7 @@ class SiteTreePermissionsTest extends FunctionalTest {
'Authenticated members cant view a page marked as "Viewable by these groups" if theyre not in the listed groups'
);
$this->session()->inst_set('loggedInAs', $subadminuser->ID);
$response = $this->get($page->URLSegment);
$response = $this->get($page->RelativeLink());
$this->assertEquals(
$response->getStatusCode(),
403,
@ -130,7 +130,7 @@ class SiteTreePermissionsTest extends FunctionalTest {
'Authenticated members can view a page marked as "Viewable by these groups" if theyre in the listed groups'
);
$this->session()->inst_set('loggedInAs', $websiteuser->ID);
$response = $this->get($page->URLSegment);
$response = $this->get($page->RelativeLink());
$this->assertEquals(
$response->getStatusCode(),
200,
@ -198,7 +198,7 @@ class SiteTreePermissionsTest extends FunctionalTest {
'Unauthenticated members cant view a page marked as "Viewable by these groups" by inherited permission'
);
$this->session()->inst_set('loggedInAs', null);
$response = $this->get($childPage->URLSegment);
$response = $this->get($childPage->RelativeLink());
$this->assertEquals(
$response->getStatusCode(),
302,
@ -212,7 +212,7 @@ class SiteTreePermissionsTest extends FunctionalTest {
'Authenticated members can view a page marked as "Viewable by these groups" if theyre in the listed groups by inherited permission'
);
$this->session()->inst_set('loggedInAs', $subadminuser->ID);
$response = $this->get($childPage->URLSegment);
$response = $this->get($childPage->RelativeLink());
$this->assertEquals(
$response->getStatusCode(),
200,