From d14d14894856adabf21a7cd7be13df9172897328 Mon Sep 17 00:00:00 2001 From: mark_story Date: Sun, 12 Dec 2010 13:18:28 -0500 Subject: [PATCH] Making scaffold form view names consistent with those used in bake. Renaming test_app files. Fixes #501 --- cake/libs/view/scaffold.php | 4 ++-- cake/libs/view/scaffolds/{edit.ctp => form.ctp} | 0 .../cases/libs/controller/scaffold.test.php | 16 ++++++++-------- .../{scaffold.edit.ctp => scaffold.form.ctp} | 0 .../{scaffold.edit.ctp => scaffold.form.ctp} | 0 5 files changed, 10 insertions(+), 10 deletions(-) rename cake/libs/view/scaffolds/{edit.ctp => form.ctp} (100%) rename cake/tests/test_app/plugins/test_plugin/views/tests/{scaffold.edit.ctp => scaffold.form.ctp} (100%) rename cake/tests/test_app/views/posts/{scaffold.edit.ctp => scaffold.form.ctp} (100%) diff --git a/cake/libs/view/scaffold.php b/cake/libs/view/scaffold.php index 032676985..ed8daa358 100644 --- a/cake/libs/view/scaffold.php +++ b/cake/libs/view/scaffold.php @@ -50,8 +50,8 @@ class ScaffoldView extends ThemeView { } } - if ($name === 'add') { - $name = 'edit'; + if ($name === 'add' || $name == 'edit') { + $name = 'form'; } $scaffoldAction = 'scaffold.' . $name; diff --git a/cake/libs/view/scaffolds/edit.ctp b/cake/libs/view/scaffolds/form.ctp similarity index 100% rename from cake/libs/view/scaffolds/edit.ctp rename to cake/libs/view/scaffolds/form.ctp diff --git a/cake/tests/cases/libs/controller/scaffold.test.php b/cake/tests/cases/libs/controller/scaffold.test.php index 17e755047..e0f925b39 100644 --- a/cake/tests/cases/libs/controller/scaffold.test.php +++ b/cake/tests/cases/libs/controller/scaffold.test.php @@ -319,11 +319,11 @@ class ScaffoldViewTest extends CakeTestCase { $this->assertEqual($result, $expected); $result = $ScaffoldView->testGetFilename('edit'); - $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'edit.ctp'; + $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp'; $this->assertEqual($result, $expected); $result = $ScaffoldView->testGetFilename('add'); - $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'edit.ctp'; + $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp'; $this->assertEqual($result, $expected); $result = $ScaffoldView->testGetFilename('view'); @@ -339,11 +339,11 @@ class ScaffoldViewTest extends CakeTestCase { $this->assertEqual($result, $expected); $result = $ScaffoldView->testGetFilename('admin_edit'); - $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'edit.ctp'; + $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp'; $this->assertEqual($result, $expected); $result = $ScaffoldView->testGetFilename('admin_add'); - $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'edit.ctp'; + $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp'; $this->assertEqual($result, $expected); $result = $ScaffoldView->testGetFilename('error'); @@ -357,11 +357,11 @@ class ScaffoldViewTest extends CakeTestCase { $ScaffoldView = new TestScaffoldView($Controller); $result = $ScaffoldView->testGetFilename('admin_edit'); - $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' .DS . 'views' . DS . 'posts' . DS . 'scaffold.edit.ctp'; + $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' .DS . 'views' . DS . 'posts' . DS . 'scaffold.form.ctp'; $this->assertEqual($result, $expected); $result = $ScaffoldView->testGetFilename('edit'); - $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' .DS . 'views' . DS . 'posts' . DS . 'scaffold.edit.ctp'; + $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' .DS . 'views' . DS . 'posts' . DS . 'scaffold.form.ctp'; $this->assertEqual($result, $expected); $Controller = new ScaffoldMockController($this->request); @@ -377,12 +377,12 @@ class ScaffoldViewTest extends CakeTestCase { $ScaffoldView = new TestScaffoldView($Controller); $result = $ScaffoldView->testGetFilename('admin_add'); $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' - . DS .'test_plugin' . DS . 'views' . DS . 'tests' . DS . 'scaffold.edit.ctp'; + . DS .'test_plugin' . DS . 'views' . DS . 'tests' . DS . 'scaffold.form.ctp'; $this->assertEqual($result, $expected); $result = $ScaffoldView->testGetFilename('add'); $expected = TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'plugins' - . DS .'test_plugin' . DS . 'views' . DS . 'tests' . DS . 'scaffold.edit.ctp'; + . DS .'test_plugin' . DS . 'views' . DS . 'tests' . DS . 'scaffold.form.ctp'; $this->assertEqual($result, $expected); Configure::write('Routing.prefixes', $_admin); diff --git a/cake/tests/test_app/plugins/test_plugin/views/tests/scaffold.edit.ctp b/cake/tests/test_app/plugins/test_plugin/views/tests/scaffold.form.ctp similarity index 100% rename from cake/tests/test_app/plugins/test_plugin/views/tests/scaffold.edit.ctp rename to cake/tests/test_app/plugins/test_plugin/views/tests/scaffold.form.ctp diff --git a/cake/tests/test_app/views/posts/scaffold.edit.ctp b/cake/tests/test_app/views/posts/scaffold.form.ctp similarity index 100% rename from cake/tests/test_app/views/posts/scaffold.edit.ctp rename to cake/tests/test_app/views/posts/scaffold.form.ctp