Browse Source

No startup and teardown for controller tests

and.. no startup/teardown functions unless they are actually going to do more
than just call parent
AD7six 13 years ago
parent
commit
a5fabcc1dc

+ 0 - 5
lib/Cake/Console/Command/Task/TestTask.php

@@ -459,11 +459,6 @@ class TestTask extends BakeTask {
 		if ($type == 'behavior') {
 			$construct = "new $fullClassName();\n";
 		}
-		if ($type == 'controller') {
-			$className = substr($fullClassName, 0, -10);
-			$construct = "new $fullClassName();\n";
-			$post = "\$this->{$className}->constructClasses();\n";
-		}
 		if ($type == 'helper') {
 			$pre = "\$View = new View();\n";
 			$construct = "new {$fullClassName}(\$View);\n";

+ 2 - 0
lib/Cake/Console/Templates/default/classes/test.ctp

@@ -44,6 +44,7 @@ class <?php echo $fullClassName; ?>Test extends CakeTestCase {
 	);
 
 <?php endif; ?>
+<?php if (!empty($construction)): ?>
 /**
  * setUp method
  *
@@ -67,6 +68,7 @@ class <?php echo $fullClassName; ?>Test extends CakeTestCase {
 		parent::tearDown();
 	}
 
+<?php endif; ?>
 <?php foreach ($methods as $method): ?>
 /**
  * test<?php echo Inflector::camelize($method); ?> method