Browse Source

Remove registry clear calls.

These registry clear calls were useful when TestTask and ModelTask could
be executed multiple times interactively. However, that is not possible
now so they are a liability that causes `bake all` to act
inconsistently.

Refs #3997
mark_story 11 years ago
parent
commit
9829646ea2

+ 0 - 1
src/Console/Command/Task/ModelTask.php

@@ -631,7 +631,6 @@ class ModelTask extends BakeTask {
 		$filename = $path . 'Table' . DS . $name . 'Table.php';
 		$this->out("\n" . __d('cake_console', 'Baking table class for %s...', $name), 1, Shell::QUIET);
 		$this->createFile($filename, $out);
-		TableRegistry::clear();
 		return $out;
 	}
 

+ 0 - 1
src/Console/Command/Task/TestTask.php

@@ -236,7 +236,6 @@ class TestTask extends BakeTask {
  * @return object And instance of the class that is going to be tested.
  */
 	public function buildTestSubject($type, $class) {
-		TableRegistry::clear();
 		if (strtolower($type) === 'table') {
 			list($namespace, $name) = namespaceSplit($class);
 			$name = str_replace('Table', '', $name);

+ 0 - 12
tests/TestCase/Console/Command/Task/TestTaskTest.php

@@ -233,18 +233,6 @@ class TestTaskTest extends TestCase {
 	}
 
 /**
- * creating test subjects should clear the registry so the registry is always fresh
- *
- * @return void
- */
-	public function testRegistryClearWhenBuildingTestObjects() {
-		$articles = TableRegistry::get('Articles');
-		$this->Task->buildTestSubject('Table', 'Posts');
-
-		$this->assertFalse(TableRegistry::exists('Articles'));
-	}
-
-/**
  * Dataprovider for class name generation.
  *
  * @return array