From 8382ebb742d5f1af2d8db17c1b8113bbb00ba950 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Wed, 6 Jul 2011 11:42:17 +0200 Subject: [PATCH] MINOR Using post() instead of submitForm() in CMSMainTest to work around SimpleTest issues --- tests/controller/CMSMainTest.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/controller/CMSMainTest.php b/tests/controller/CMSMainTest.php index d9f0ecb4..2bf270ab 100644 --- a/tests/controller/CMSMainTest.php +++ b/tests/controller/CMSMainTest.php @@ -198,22 +198,22 @@ class CMSMainTest extends FunctionalTest { // with insufficient permissions $cmsUser->logIn(); $this->get('admin/pages'); - $response = $this->submitForm( - 'Form_AddForm', - null, - array('ParentID' => '0', 'ClassName' => 'Page', 'Locale' => 'en_US') + $response = $this->post( + 'admin/pages/AddForm', + array('ParentID' => '0', 'ClassName' => 'Page', 'Locale' => 'en_US', 'action_doAdd' => 1) ); // should redirect, which is a permission error $this->assertEquals(403, $response->getStatusCode(), 'Add TopLevel page must fail for normal user'); // with correct permissions $rootEditUser->logIn(); - $this->get('admin/pages/'); - $response = $this->submitForm( - 'Form_AddForm', - null, - array('ParentID' => '0', 'ClassName' => 'Page', 'Locale' => 'en_US') + $response = $this->get('admin/pages/'); + + $response = $this->post( + 'admin/pages/AddForm', + array('ParentID' => '0', 'ClassName' => 'Page', 'Locale' => 'en_US', 'action_doAdd' => 1) ); + $this->assertEquals(302, $response->getStatusCode(), 'Must be a redirect on success'); $location=$response->getHeader('Location'); $this->assertContains('/show/',$location, 'Must redirect to /show/ the new page');