mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Making scaffold form view names consistent with those used in bake.
Renaming test_app files. Fixes #501
This commit is contained in:
parent
11df32148f
commit
d14d148948
5 changed files with 10 additions and 10 deletions
|
@ -50,8 +50,8 @@ class ScaffoldView extends ThemeView {
|
|||
}
|
||||
}
|
||||
|
||||
if ($name === 'add') {
|
||||
$name = 'edit';
|
||||
if ($name === 'add' || $name == 'edit') {
|
||||
$name = 'form';
|
||||
}
|
||||
|
||||
$scaffoldAction = 'scaffold.' . $name;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue