diff --git a/cake/console/libs/templates/objects/controller_actions.ctp b/cake/console/libs/templates/objects/controller_actions.ctp index c4b1ce935..99b18bd33 100644 --- a/cake/console/libs/templates/objects/controller_actions.ctp +++ b/cake/console/libs/templates/objects/controller_actions.ctp @@ -30,9 +30,9 @@ if (!$id) { $this->Session->setFlash(__('Invalid ', true)); - $this->redirect(array('action'=>'index')); + $this->redirect(array('action' => 'index')); - $this->flash(__('Invalid ', true), array('action'=>'index')); + $this->flash(__('Invalid ', true), array('action' => 'index')); } $this->set('', $this->->read(null, $id)); @@ -45,9 +45,9 @@ if ($this->->save($this->data)) { $this->Session->setFlash(__('The has been saved', true)); - $this->redirect(array('action'=>'index')); + $this->redirect(array('action' => 'index')); - $this->flash(__(' saved.', true), array('action'=>'index')); + $this->flash(__(' saved.', true), array('action' => 'index')); } else { @@ -77,18 +77,18 @@ if (!$id && empty($this->data)) { $this->Session->setFlash(__('Invalid ', true)); - $this->redirect(array('action'=>'index')); + $this->redirect(array('action' => 'index')); - $this->flash(__('Invalid ', true), array('action'=>'index')); + $this->flash(__('Invalid ', true), array('action' => 'index')); } if (!empty($this->data)) { if ($this->->save($this->data)) { $this->Session->setFlash(__('The has been saved', true)); - $this->redirect(array('action'=>'index')); + $this->redirect(array('action' => 'index')); - $this->flash(__('The has been saved.', true), array('action'=>'index')); + $this->flash(__('The has been saved.', true), array('action' => 'index')); } else { @@ -122,7 +122,7 @@ $this->Session->setFlash(__('Invalid id for ', true)); $this->redirect(array('action'=>'index')); - $this->flash(__('Invalid ', true), array('action'=>'index')); + $this->flash(__('Invalid ', true), array('action' => 'index')); } if ($this->->del($id)) { @@ -130,7 +130,13 @@ $this->Session->setFlash(__(' deleted', true)); $this->redirect(array('action'=>'index')); - $this->flash(__(' deleted', true), array('action'=>'index')); + $this->flash(__(' deleted', true), array('action' => 'index')); } + + $this->Session->setFlash(__(' was not deleted', true)); + + $this->flash(__(' was not deleted', true), array('action' => 'index')); + + $this->redirect(array('action' => 'index')); } diff --git a/cake/tests/cases/console/libs/tasks/controller.test.php b/cake/tests/cases/console/libs/tasks/controller.test.php index 0efaedbec..0cd154c8c 100644 --- a/cake/tests/cases/console/libs/tasks/controller.test.php +++ b/cake/tests/cases/console/libs/tasks/controller.test.php @@ -318,13 +318,13 @@ class ControllerTaskTest extends CakeTestCase { $this->assertTrue(strpos($result, "\$this->set('articles', \$this->paginate());") !== false); $this->assertTrue(strpos($result, 'function view($id = null)') !== false); - $this->assertTrue(strpos($result, "\$this->flash(__('Invalid Article', true), array('action'=>'index'))") !== false); + $this->assertTrue(strpos($result, "\$this->flash(__('Invalid Article', true), array('action' => 'index'))") !== false); $this->assertTrue(strpos($result, "\$this->set('article', \$this->Article->read(null, \$id)") !== false); $this->assertTrue(strpos($result, 'function add()') !== false); $this->assertTrue(strpos($result, 'if (!empty($this->data))') !== false); $this->assertTrue(strpos($result, 'if ($this->Article->save($this->data))') !== false); - $this->assertTrue(strpos($result, "\$this->flash(__('The Article has been saved.', true), array('action'=>'index'))") !== false); + $this->assertTrue(strpos($result, "\$this->flash(__('The Article has been saved.', true), array('action' => 'index'))") !== false); $this->assertTrue(strpos($result, 'function edit($id = null)') !== false); $this->assertTrue(strpos($result, "\$this->Article->Tag->find('list')") !== false); @@ -332,7 +332,7 @@ class ControllerTaskTest extends CakeTestCase { $this->assertTrue(strpos($result, 'function delete($id = null)') !== false); $this->assertTrue(strpos($result, 'if ($this->Article->del($id))') !== false); - $this->assertTrue(strpos($result, "\$this->flash(__('Article deleted', true), array('action'=>'index'))") !== false); + $this->assertTrue(strpos($result, "\$this->flash(__('Article deleted', true), array('action' => 'index'))") !== false); } /**