Skip to content
Permalink
Browse files

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
  • Loading branch information...
markstory committed Jul 18, 2014
1 parent 5aa85db commit 9829646ea2e56a005796714e52ded5b8ef48b09c
@@ -631,7 +631,6 @@ public function bakeTable($model, array $data = []) {
$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;
}
@@ -236,7 +236,6 @@ public function typeCanDetectFixtures($type) {
* @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);
@@ -232,18 +232,6 @@ public function testFixtureArrayGenerationFromController() {
$this->assertEquals($expected, $result);
}
/**
* 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.
*

0 comments on commit 9829646

Please sign in to comment.
You can’t perform that action at this time.