From 11df32148f9d0cd7f620b9ee829eea8373e37558 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 12 Dec 2010 13:13:00 -0500 Subject: [PATCH] Updating scaffold templates to use post forms for delete buttons. Updating test case. --- cake/libs/view/scaffolds/edit.ctp | 11 ++++-- cake/libs/view/scaffolds/index.ctp | 36 ++++++++++--------- .../cases/libs/controller/scaffold.test.php | 2 +- 3 files changed, 29 insertions(+), 20 deletions(-) diff --git a/cake/libs/view/scaffolds/edit.ctp b/cake/libs/view/scaffolds/edit.ctp index 3e59682b5..7fb2c4c8b 100644 --- a/cake/libs/view/scaffolds/edit.ctp +++ b/cake/libs/view/scaffolds/edit.ctp @@ -27,10 +27,15 @@

@@ -82,8 +86,8 @@ echo "\n"; foreach ($associations as $_type => $_data) { foreach ($_data as $_alias => $_details) { if ($_details['controller'] != $this->name && !in_array($_details['controller'], $done)) { - echo "\t\t
  • " . $this->Html->link(__('List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "
  • \n"; - echo "\t\t
  • " . $this->Html->link(__('New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "
  • \n"; + echo "
  • " . $this->Html->link(__('List %s', Inflector::humanize($_details['controller'])), array('controller' => $_details['controller'], 'action' => 'index')) . "
  • "; + echo "
  • " . $this->Html->link(__('New %s', Inflector::humanize(Inflector::underscore($_alias))), array('controller' => $_details['controller'], 'action' => 'add')) . "
  • "; $done[] = $_details['controller']; } } diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/cake/tests/cases/libs/controller/scaffold.test.php index 2ebd3f5e3..17e755047 100644 --- a/cake/tests/cases/libs/controller/scaffold.test.php +++ b/cake/tests/cases/libs/controller/scaffold.test.php @@ -524,7 +524,7 @@ class ScaffoldViewTest extends CakeTestCase { $this->assertContains('input name="data[ScaffoldMock][title]" maxlength="255" type="text" value="First Article" id="ScaffoldMockTitle"', $result); $this->assertContains('input name="data[ScaffoldMock][published]" maxlength="1" type="text" value="Y" id="ScaffoldMockPublished"', $result); $this->assertContains('textarea name="data[ScaffoldMock][body]" cols="30" rows="6" id="ScaffoldMockBody"', $result); - $this->assertPattern('/
  • ]*>Delete<\/a>\s*<\/li>/', $result); + $this->assertPattern('/