mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-04 15:18:29 +02:00
MINOR Changed CMSMainTest to use new LeftAndMain->doAdd() controller actions, not the removed addform()
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@102787 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
47dfe8b2ab
commit
6ea662cd05
@ -171,13 +171,23 @@ class CMSMainTest extends FunctionalTest {
|
|||||||
|
|
||||||
// with insufficient permissions
|
// with insufficient permissions
|
||||||
$cmsUser->logIn();
|
$cmsUser->logIn();
|
||||||
$response = $this->post('admin/addpage', array('ParentID' => '0', 'PageType' => 'Page', 'Locale' => 'en_US'));
|
$this->get('admin');
|
||||||
|
$response = $this->submitForm(
|
||||||
|
'Form_AddForm',
|
||||||
|
null,
|
||||||
|
array('ParentID' => '0', 'PageType' => 'Page', 'Locale' => 'en_US')
|
||||||
|
);
|
||||||
// should redirect, which is a permission error
|
// should redirect, which is a permission error
|
||||||
$this->assertEquals(403, $response->getStatusCode(), 'Add TopLevel page must fail for normal user');
|
$this->assertEquals(403, $response->getStatusCode(), 'Add TopLevel page must fail for normal user');
|
||||||
|
|
||||||
// with correct permissions
|
// with correct permissions
|
||||||
$rootEditUser->logIn();
|
$rootEditUser->logIn();
|
||||||
$response = $this->post('admin/addpage', array('ParentID' => '0', 'PageType' => 'Page', 'Locale' => 'en_US'));
|
$this->get('admin');
|
||||||
|
$response = $this->submitForm(
|
||||||
|
'Form_AddForm',
|
||||||
|
null,
|
||||||
|
array('ParentID' => '0', 'PageType' => 'Page', 'Locale' => 'en_US')
|
||||||
|
);
|
||||||
$this->assertEquals(302, $response->getStatusCode(), 'Must be a redirect on success');
|
$this->assertEquals(302, $response->getStatusCode(), 'Must be a redirect on success');
|
||||||
$location=$response->getHeader('Location');
|
$location=$response->getHeader('Location');
|
||||||
$this->assertContains('/show/',$location, 'Must redirect to /show/ the new page');
|
$this->assertContains('/show/',$location, 'Must redirect to /show/ the new page');
|
||||||
|
Loading…
Reference in New Issue
Block a user