Skip to content
This repository
Browse code

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
Mark Story authored August 03, 2009
4  cake/libs/controller/scaffold.php
@@ -167,7 +167,7 @@ function __construct(&$controller, $params) {
167 167
 		$associations = $this->__associations();
168 168
 
169 169
 		$this->controller->set(compact('modelClass', 'primaryKey', 'displayField', 'singularVar', 'pluralVar',
170  
-								'singularHumanName', 'pluralHumanName', 'scaffoldFields', 'associations'));
  170
+			'singularHumanName', 'pluralHumanName', 'scaffoldFields', 'associations'));
171 171
 
172 172
 		if ($this->controller->view && $this->controller->view !== 'Theme') {
173 173
 			$this->controller->view = 'scaffold';
@@ -378,7 +378,7 @@ function __scaffoldError() {
378 378
  * @access private
379 379
  */
380 380
 	function __scaffold($params) {
381  
-		$db = &ConnectionManager::getDataSource($this->ScaffoldModel->useDbConfig);
  381
+		$db =& ConnectionManager::getDataSource($this->ScaffoldModel->useDbConfig);
382 382
 		$admin = Configure::read('Routing.admin');
383 383
 
384 384
 		if (isset($db)) {
20  cake/tests/cases/libs/controller/scaffold.test.php
@@ -228,21 +228,21 @@ class ScaffoldViewTest extends CakeTestCase {
228 228
  */
229 229
 	var $fixtures = array('core.article', 'core.user', 'core.comment');
230 230
 /**
231  
- * setUp method
  231
+ * startTest method
232 232
  *
233 233
  * @access public
234 234
  * @return void
235 235
  */
236  
-	function setUp() {
  236
+	function startTest() {
237 237
 		$this->Controller =& new ScaffoldMockController();
238 238
 	}
239 239
 /**
240  
- * tearDown method
  240
+ * endTest method
241 241
  *
242 242
  * @access public
243 243
  * @return void
244 244
  */
245  
-	function tearDown() {
  245
+	function endTest() {
246 246
 		unset($this->Controller);
247 247
 	}
248 248
 /**
@@ -452,7 +452,6 @@ function testEditScaffold() {
452 452
 		$this->assertPattern('/textarea name="data\[ScaffoldMock\]\[body\]" cols="30" rows="6" id="ScaffoldMockBody"/', $result);
453 453
 		$this->assertPattern('/<li><a href="\/scaffold_mock\/delete\/1"[^>]*>Delete<\/a>\s*<\/li>/', $result);
454 454
 	}
455  
-
456 455
 /**
457 456
  * Test Admin Index Scaffolding.
458 457
  *
@@ -562,21 +561,21 @@ class ScaffoldTest extends CakeTestCase {
562 561
  */
563 562
 	var $fixtures = array('core.article', 'core.user', 'core.comment');
564 563
 /**
565  
- * setUp method
  564
+ * startTest method
566 565
  *
567 566
  * @access public
568 567
  * @return void
569 568
  */
570  
-	function setUp() {
  569
+	function startTest() {
571 570
 		$this->Controller =& new ScaffoldMockController();
572 571
 	}
573 572
 /**
574  
- * tearDown method
  573
+ * endTest method
575 574
  *
576 575
  * @access public
577 576
  * @return void
578 577
  */
579  
-	function tearDown() {
  578
+	function endTest() {
580 579
 		unset($this->Controller);
581 580
 	}
582 581
 /**
@@ -611,7 +610,6 @@ function testScaffoldParams() {
611 610
 		$result = $Scaffold->getParams();
612 611
 		$this->assertEqual($result['action'], 'admin_edit');
613 612
 	}
614  
-
615 613
 /**
616 614
  * test that the proper names and variable values are set by Scaffold
617 615
  *
@@ -639,7 +637,7 @@ function testScaffoldVariableSetting() {
639 637
 		$this->Controller->base = '/';
640 638
 		$this->Controller->constructClasses();
641 639
 		$Scaffold =& new TestScaffoldMock($this->Controller, $params);
642  
-		$result = $this->Controller->viewVars;
  640
+		$result = $Scaffold->controller->viewVars;
643 641
 
644 642
 		$this->assertEqual($result['singularHumanName'], 'Scaffold Mock');
645 643
 		$this->assertEqual($result['pluralHumanName'], 'Scaffold Mock');

0 notes on commit 29dd4dd

Please sign in to comment.
Something went wrong with that request. Please try again.