mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
BUG FIx merge regressions in versioned tests
This commit is contained in:
parent
ad1c058616
commit
54ae002d19
@ -21,12 +21,16 @@ class ContentControllerPermissionsTest extends FunctionalTest {
|
||||
$page->write();
|
||||
|
||||
$response = $this->get('/testpage');
|
||||
$this->assertEquals($response->getStatusCode(), 200, 'Doesnt require login for implicit live stage');
|
||||
$this->assertEquals($response->getStatusCode(), 200, "Doesn't require login for implicit live stage");
|
||||
|
||||
$response = $this->get('/testpage/?stage=Live');
|
||||
$this->assertEquals($response->getStatusCode(), 200, 'Doesnt require login for explicit live stage');
|
||||
|
||||
$response = $this->get('/testpage/?stage=Stage');
|
||||
$this->assertEquals($response->getStatusCode(), 200, "Doesn't require login for explicit live stage");
|
||||
|
||||
try {
|
||||
$response = $this->get('/testpage/?stage=Stage');
|
||||
} catch(SS_HTTPResponse_Exception $responseException) {
|
||||
$response = $responseException->getResponse();
|
||||
}
|
||||
// should redirect to login
|
||||
$this->assertEquals($response->getStatusCode(), 302, 'Redirects to login page when not logged in for draft stage');
|
||||
$this->assertContains(
|
||||
|
@ -96,7 +96,13 @@ class ContentControllerTest extends FunctionalTest {
|
||||
|
||||
// test when user does not have permission, should get login form
|
||||
$this->logInWithPermission('EDITOR');
|
||||
$this->assertEquals('403', $this->get('/contact/?stage=Stage')->getstatusCode());
|
||||
try {
|
||||
$response = $this->get('/contact/?stage=Stage');
|
||||
} catch(SS_HTTPResponse_Exception $responseException) {
|
||||
$response = $responseException->getResponse();
|
||||
}
|
||||
|
||||
$this->assertEquals('403', $response->getstatusCode());
|
||||
|
||||
|
||||
// test when user does have permission, should show page title and header ok.
|
||||
|
@ -40,7 +40,11 @@ class SiteTreePermissionsTest extends FunctionalTest {
|
||||
$this->assertEquals($response->getStatusCode(), '404');
|
||||
|
||||
// should be prompted for a login
|
||||
$response = $this->get($page->URLSegment . '?stage=Stage');
|
||||
try {
|
||||
$response = $this->get($page->URLSegment . '?stage=Stage');
|
||||
} catch(SS_HTTPResponse_Exception $responseException) {
|
||||
$response = $responseException->getResponse();
|
||||
}
|
||||
$this->assertEquals($response->getStatusCode(), '302');
|
||||
$this->assertContains(
|
||||
Config::inst()->get('Security', 'login_url'),
|
||||
|
Loading…
Reference in New Issue
Block a user