Browse Source

Merge branch 'master' into 2.4

mark_story 13 years ago
parent
commit
026df62a1f

+ 2 - 0
lib/Cake/Console/Command/SchemaShell.php

@@ -53,6 +53,8 @@ class SchemaShell extends AppShell {
 		$this->out('Cake Schema Shell');
 		$this->hr();
 
+		Configure::write('Cache.disable', 1);
+
 		$name = $path = $connection = $plugin = null;
 		if (!empty($this->params['name'])) {
 			$name = $this->params['name'];

+ 5 - 1
lib/Cake/TestSuite/CakeTestCase.php

@@ -43,7 +43,11 @@ abstract class CakeTestCase extends PHPUnit_Framework_TestCase {
 	public $autoFixtures = true;
 
 /**
+ * Control table create/drops on each test method.
+ *
  * Set this to false to avoid tables to be dropped if they already exist
+ * between each test method. Tables will still be dropped at the
+ * end of each test runner execution.
  *
  * @var boolean
  */
@@ -205,7 +209,7 @@ abstract class CakeTestCase extends PHPUnit_Framework_TestCase {
 		}
 		$args = func_get_args();
 		foreach ($args as $class) {
-			$this->fixtureManager->loadSingle($class);
+			$this->fixtureManager->loadSingle($class, null, $this->dropTables);
 		}
 	}
 

+ 3 - 2
lib/Cake/TestSuite/Fixture/CakeFixtureManager.php

@@ -243,17 +243,18 @@ class CakeFixtureManager {
  *
  * @param string $name of the fixture
  * @param DataSource $db DataSource instance or leave null to get DataSource from the fixture
+ * @param boolean $dropTables Whether or not tables should be dropped and re-created.
  * @return void
  * @throws UnexpectedValueException if $name is not a previously loaded class
  */
-	public function loadSingle($name, $db = null) {
+	public function loadSingle($name, $db = null, $dropTables = true) {
 		$name .= 'Fixture';
 		if (isset($this->_fixtureMap[$name])) {
 			$fixture = $this->_fixtureMap[$name];
 			if (!$db) {
 				$db = ConnectionManager::getDataSource($fixture->useDbConfig);
 			}
-			$this->_setupTable($fixture, $db);
+			$this->_setupTable($fixture, $db, $dropTables);
 			$fixture->truncate($db);
 			$fixture->insert($db);
 		} else {