mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-02-07 12:36:25 +00:00
partial fix for the scaffold test
This commit is contained in:
parent
eafc8259e5
commit
20f541108e
2 changed files with 29 additions and 29 deletions
|
@ -307,58 +307,58 @@ class ScaffoldViewTest extends CakeTestCase {
|
||||||
$this->Controller->request->params['action'] = 'index';
|
$this->Controller->request->params['action'] = 'index';
|
||||||
$ScaffoldView = new TestScaffoldView($this->Controller);
|
$ScaffoldView = new TestScaffoldView($this->Controller);
|
||||||
$result = $ScaffoldView->testGetFilename('index');
|
$result = $ScaffoldView->testGetFilename('index');
|
||||||
$expected = CAKE . 'View' . DS . 'scaffolds' . DS . 'index.ctp';
|
$expected = CAKE . 'View' . DS . 'Scaffolds' . DS . 'index.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$result = $ScaffoldView->testGetFilename('edit');
|
$result = $ScaffoldView->testGetFilename('edit');
|
||||||
$expected = CAKE . 'View' . DS . 'scaffolds' . DS . 'form.ctp';
|
$expected = CAKE . 'View' . DS . 'Scaffolds' . DS . 'form.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$result = $ScaffoldView->testGetFilename('add');
|
$result = $ScaffoldView->testGetFilename('add');
|
||||||
$expected = CAKE . 'View' . DS . 'scaffolds' . DS . 'form.ctp';
|
$expected = CAKE . 'View' . DS . 'Scaffolds' . DS . 'form.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$result = $ScaffoldView->testGetFilename('view');
|
$result = $ScaffoldView->testGetFilename('view');
|
||||||
$expected = CAKE . 'View' . DS . 'scaffolds' . DS . 'view.ctp';
|
$expected = CAKE . 'View' . DS . 'Scaffolds' . DS . 'view.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$result = $ScaffoldView->testGetFilename('admin_index');
|
$result = $ScaffoldView->testGetFilename('admin_index');
|
||||||
$expected = CAKE . 'View' . DS . 'scaffolds' . DS . 'index.ctp';
|
$expected = CAKE . 'View' . DS . 'Scaffolds' . DS . 'index.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$result = $ScaffoldView->testGetFilename('admin_view');
|
$result = $ScaffoldView->testGetFilename('admin_view');
|
||||||
$expected = CAKE . 'View' . DS . 'scaffolds' . DS . 'view.ctp';
|
$expected = CAKE . 'View' . DS . 'Scaffolds' . DS . 'view.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$result = $ScaffoldView->testGetFilename('admin_edit');
|
$result = $ScaffoldView->testGetFilename('admin_edit');
|
||||||
$expected =CAKE . 'View' . DS . 'scaffolds' . DS . 'form.ctp';
|
$expected =CAKE . 'View' . DS . 'Scaffolds' . DS . 'form.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$result = $ScaffoldView->testGetFilename('admin_add');
|
$result = $ScaffoldView->testGetFilename('admin_add');
|
||||||
$expected = CAKE . 'View' . DS . 'scaffolds' . DS . 'form.ctp';
|
$expected = CAKE . 'View' . DS . 'Scaffolds' . DS . 'form.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$result = $ScaffoldView->testGetFilename('error');
|
$result = $ScaffoldView->testGetFilename('error');
|
||||||
$expected = CAKE . 'View' . DS . 'errors' . DS . 'scaffold_error.ctp';
|
$expected = CAKE . 'View' . DS . 'Errors' . DS . 'scaffold_error.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$Controller = new ScaffoldMockController($this->request);
|
$Controller = new ScaffoldMockController($this->request);
|
||||||
$Controller->scaffold = 'admin';
|
$Controller->scaffold = 'admin';
|
||||||
$Controller->viewPath = 'posts';
|
$Controller->viewPath = 'Posts';
|
||||||
$Controller->request['action'] = 'admin_edit';
|
$Controller->request['action'] = 'admin_edit';
|
||||||
|
|
||||||
$ScaffoldView = new TestScaffoldView($Controller);
|
$ScaffoldView = new TestScaffoldView($Controller);
|
||||||
$result = $ScaffoldView->testGetFilename('admin_edit');
|
$result = $ScaffoldView->testGetFilename('admin_edit');
|
||||||
$expected = CAKE . 'Test' . DS . 'test_app' .DS . 'View' . DS . 'Posts' . DS . 'scaffold.form.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' .DS . 'View' . DS . 'Posts' . DS . 'scaffold.form.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$result = $ScaffoldView->testGetFilename('edit');
|
$result = $ScaffoldView->testGetFilename('edit');
|
||||||
$expected = CAKE . 'Test' . DS . 'test_app' .DS . 'View' . DS . 'Posts' . DS . 'scaffold.form.ctp';
|
$expected = CAKE . 'Test' . DS . 'test_app' .DS . 'View' . DS . 'Posts' . DS . 'scaffold.form.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$Controller = new ScaffoldMockController($this->request);
|
$Controller = new ScaffoldMockController($this->request);
|
||||||
$Controller->scaffold = 'admin';
|
$Controller->scaffold = 'admin';
|
||||||
$Controller->viewPath = 'tests';
|
$Controller->viewPath = 'Tests';
|
||||||
$Controller->request->addParams(array(
|
$Controller->request->addParams(array(
|
||||||
'plugin' => 'test_plugin',
|
'plugin' => 'test_plugin',
|
||||||
'action' => 'admin_add',
|
'action' => 'admin_add',
|
||||||
|
@ -370,12 +370,12 @@ class ScaffoldViewTest extends CakeTestCase {
|
||||||
$result = $ScaffoldView->testGetFilename('admin_add');
|
$result = $ScaffoldView->testGetFilename('admin_add');
|
||||||
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin'
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin'
|
||||||
. DS .'test_plugin' . DS . 'View' . DS . 'tests' . DS . 'scaffold.form.ctp';
|
. DS .'test_plugin' . DS . 'View' . DS . 'tests' . DS . 'scaffold.form.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
$result = $ScaffoldView->testGetFilename('add');
|
$result = $ScaffoldView->testGetFilename('add');
|
||||||
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin'
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin'
|
||||||
. DS .'test_plugin' . DS . 'View' . DS . 'tests' . DS . 'scaffold.form.ctp';
|
. DS .'test_plugin' . DS . 'View' . DS . 'tests' . DS . 'scaffold.form.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($expected, $result);
|
||||||
|
|
||||||
Configure::write('Routing.prefixes', $_admin);
|
Configure::write('Routing.prefixes', $_admin);
|
||||||
}
|
}
|
||||||
|
@ -387,14 +387,14 @@ class ScaffoldViewTest extends CakeTestCase {
|
||||||
*/
|
*/
|
||||||
function testGetViewFileNameWithTheme() {
|
function testGetViewFileNameWithTheme() {
|
||||||
$this->Controller->request['action'] = 'index';
|
$this->Controller->request['action'] = 'index';
|
||||||
$this->Controller->viewPath = 'posts';
|
$this->Controller->viewPath = 'Posts';
|
||||||
$this->Controller->theme = 'test_theme';
|
$this->Controller->theme = 'test_theme';
|
||||||
$ScaffoldView = new TestScaffoldView($this->Controller);
|
$ScaffoldView = new TestScaffoldView($this->Controller);
|
||||||
|
|
||||||
$result = $ScaffoldView->testGetFilename('index');
|
$result = $ScaffoldView->testGetFilename('index');
|
||||||
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS
|
$expected = CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS
|
||||||
. 'themed' . DS . 'test_theme' . DS . 'posts' . DS . 'scaffold.index.ctp';
|
. 'Themed' . DS . 'test_theme' . DS . 'Posts' . DS . 'scaffold.index.ctp';
|
||||||
$this->assertEqual($result, $expected);
|
$this->assertEqual($expected, $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -62,7 +62,7 @@ class ScaffoldView extends ThemeView {
|
||||||
}
|
}
|
||||||
|
|
||||||
$names[] = $this->viewPath . DS . $subDir . $scaffoldAction;
|
$names[] = $this->viewPath . DS . $subDir . $scaffoldAction;
|
||||||
$names[] = 'scaffolds' . DS . $subDir . $name;
|
$names[] = 'Scaffolds' . DS . $subDir . $name;
|
||||||
|
|
||||||
$paths = $this->_paths($this->plugin);
|
$paths = $this->_paths($this->plugin);
|
||||||
$exts = array($this->ext);
|
$exts = array($this->ext);
|
||||||
|
@ -79,7 +79,7 @@ class ScaffoldView extends ThemeView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($name === 'scaffolds' . DS . $subDir . 'error') {
|
if ($name === 'Scaffolds' . DS . $subDir . 'error') {
|
||||||
return CAKE . 'View' . DS . 'Errors' . DS . 'scaffold_error.ctp';
|
return CAKE . 'View' . DS . 'Errors' . DS . 'scaffold_error.ctp';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue