Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixing issues in Scaffold Test case with PHP4.

Cleaning up code formatting in Scaffold.

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@8276 3807eeeb-6ff5-0310-8944-8be069107fe0
  • Loading branch information...
commit 29dd4ddf034861646747b42872823727e518027a 1 parent 07d1ecd
@markstory markstory authored
View
4 cake/libs/controller/scaffold.php
@@ -167,7 +167,7 @@ function __construct(&$controller, $params) {
$associations = $this->__associations();
$this->controller->set(compact('modelClass', 'primaryKey', 'displayField', 'singularVar', 'pluralVar',
- 'singularHumanName', 'pluralHumanName', 'scaffoldFields', 'associations'));
+ 'singularHumanName', 'pluralHumanName', 'scaffoldFields', 'associations'));
if ($this->controller->view && $this->controller->view !== 'Theme') {
$this->controller->view = 'scaffold';
@@ -378,7 +378,7 @@ function __scaffoldError() {
* @access private
*/
function __scaffold($params) {
- $db = &ConnectionManager::getDataSource($this->ScaffoldModel->useDbConfig);
+ $db =& ConnectionManager::getDataSource($this->ScaffoldModel->useDbConfig);
$admin = Configure::read('Routing.admin');
if (isset($db)) {
View
20 cake/tests/cases/libs/controller/scaffold.test.php
@@ -228,21 +228,21 @@ class ScaffoldViewTest extends CakeTestCase {
*/
var $fixtures = array('core.article', 'core.user', 'core.comment');
/**
- * setUp method
+ * startTest method
*
* @access public
* @return void
*/
- function setUp() {
+ function startTest() {
$this->Controller =& new ScaffoldMockController();
}
/**
- * tearDown method
+ * endTest method
*
* @access public
* @return void
*/
- function tearDown() {
+ function endTest() {
unset($this->Controller);
}
/**
@@ -452,7 +452,6 @@ function testEditScaffold() {
$this->assertPattern('/textarea name="data\[ScaffoldMock\]\[body\]" cols="30" rows="6" id="ScaffoldMockBody"/', $result);
$this->assertPattern('/<li><a href="\/scaffold_mock\/delete\/1"[^>]*>Delete<\/a>\s*<\/li>/', $result);
}
-
/**
* Test Admin Index Scaffolding.
*
@@ -562,21 +561,21 @@ class ScaffoldTest extends CakeTestCase {
*/
var $fixtures = array('core.article', 'core.user', 'core.comment');
/**
- * setUp method
+ * startTest method
*
* @access public
* @return void
*/
- function setUp() {
+ function startTest() {
$this->Controller =& new ScaffoldMockController();
}
/**
- * tearDown method
+ * endTest method
*
* @access public
* @return void
*/
- function tearDown() {
+ function endTest() {
unset($this->Controller);
}
/**
@@ -611,7 +610,6 @@ function testScaffoldParams() {
$result = $Scaffold->getParams();
$this->assertEqual($result['action'], 'admin_edit');
}
-
/**
* test that the proper names and variable values are set by Scaffold
*
@@ -639,7 +637,7 @@ function testScaffoldVariableSetting() {
$this->Controller->base = '/';
$this->Controller->constructClasses();
$Scaffold =& new TestScaffoldMock($this->Controller, $params);
- $result = $this->Controller->viewVars;
+ $result = $Scaffold->controller->viewVars;
$this->assertEqual($result['singularHumanName'], 'Scaffold Mock');
$this->assertEqual($result['pluralHumanName'], 'Scaffold Mock');
Please sign in to comment.
Something went wrong with that request. Please try again.