Fixing ScaffoldView test

This commit is contained in:
José Lorenzo Rodríguez 2011-02-22 22:47:07 -04:30
parent 90cdf5102e
commit 4e1fcbed61
2 changed files with 14 additions and 12 deletions

View file

@ -80,7 +80,7 @@ class ScaffoldView extends ThemeView {
} }
if ($name === 'scaffolds' . DS . $subDir . 'error') { if ($name === 'scaffolds' . DS . $subDir . 'error') {
return LIBS . 'view' . DS . 'errors' . DS . 'scaffold_error.ctp'; return LIBS . 'View' . DS . 'errors' . DS . 'scaffold_error.ctp';
} }
throw new MissingViewException($paths[0] . $name . $this->ext); throw new MissingViewException($paths[0] . $name . $this->ext);

View file

@ -16,8 +16,10 @@
* @since CakePHP(tm) v 1.2.0.5436 * @since CakePHP(tm) v 1.2.0.5436
* @license MIT License (http://www.opensource.org/licenses/mit-license.php) * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/ */
App::uses('Scaffold', 'Controller');
App::uses('Controller', 'Controller'); App::uses('Controller', 'Controller');
App::uses('Scaffold', 'Controller');
App::uses('ScaffoldView', 'View');
/** /**
* ScaffoldMockController class * ScaffoldMockController class
@ -277,7 +279,7 @@ class ScaffoldViewTest extends CakeTestCase {
$this->Controller->response = $this->getMock('CakeResponse', array('_sendHeader')); $this->Controller->response = $this->getMock('CakeResponse', array('_sendHeader'));
App::build(array( App::build(array(
'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS), 'View' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'views' . DS),
'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS) 'plugins' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'plugins' . DS)
)); ));
} }
@ -305,39 +307,39 @@ 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 = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'index.ctp'; $expected = LIBS . 'View' . DS . 'scaffolds' . DS . 'index.ctp';
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('edit'); $result = $ScaffoldView->testGetFilename('edit');
$expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp'; $expected = LIBS . 'View' . DS . 'scaffolds' . DS . 'form.ctp';
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('add'); $result = $ScaffoldView->testGetFilename('add');
$expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp'; $expected = LIBS . 'View' . DS . 'scaffolds' . DS . 'form.ctp';
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('view'); $result = $ScaffoldView->testGetFilename('view');
$expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'view.ctp'; $expected = LIBS . 'View' . DS . 'scaffolds' . DS . 'view.ctp';
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('admin_index'); $result = $ScaffoldView->testGetFilename('admin_index');
$expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'index.ctp'; $expected = LIBS . 'View' . DS . 'scaffolds' . DS . 'index.ctp';
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('admin_view'); $result = $ScaffoldView->testGetFilename('admin_view');
$expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'view.ctp'; $expected = LIBS . 'View' . DS . 'scaffolds' . DS . 'view.ctp';
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('admin_edit'); $result = $ScaffoldView->testGetFilename('admin_edit');
$expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp'; $expected =LIBS . 'View' . DS . 'scaffolds' . DS . 'form.ctp';
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('admin_add'); $result = $ScaffoldView->testGetFilename('admin_add');
$expected = LIBS . 'libs' . DS . 'view' . DS . 'scaffolds' . DS . 'form.ctp'; $expected = LIBS . 'View' . DS . 'scaffolds' . DS . 'form.ctp';
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
$result = $ScaffoldView->testGetFilename('error'); $result = $ScaffoldView->testGetFilename('error');
$expected = CAKE . 'libs' . DS . 'view' . DS . 'errors' . DS . 'scaffold_error.ctp'; $expected = LIBS . 'View' . DS . 'errors' . DS . 'scaffold_error.ctp';
$this->assertEqual($result, $expected); $this->assertEqual($result, $expected);
$Controller = new ScaffoldMockController($this->request); $Controller = new ScaffoldMockController($this->request);