Browse Source

Travis is still unhappy, moving more stuff around

Jose Lorenzo Rodriguez 12 years ago
parent
commit
5c1db4ceee

+ 1 - 0
src/TestSuite/Fixture/FixtureInjector.php

@@ -116,6 +116,7 @@ class FixtureInjector implements PHPUnit_Framework_TestListener {
  */
 	public function startTest(PHPUnit_Framework_Test $test) {
 		$test->fixtureManager = $this->_fixtureManager;
+		$this->_fixtureManager->fixturize($test);
 		$this->_fixtureManager->load($test);
 	}
 

+ 2 - 5
src/TestSuite/Fixture/FixtureManager.php

@@ -223,7 +223,6 @@ class FixtureManager {
 		}
 
 		$dbs = [];
-		$this->fixturize($test);
 		foreach ($fixtures as $f) {
 			if (!empty($this->_loaded[$f])) {
 				$fixture = $this->_loaded[$f];
@@ -256,7 +255,7 @@ class FixtureManager {
  * @return void
  */
 	public function unload(TestCase $test) {
-		$fixtures = !empty($test->fixtures) ? $test->fixtures : array();
+		$fixtures = !empty($test->fixtures) ? $test->fixtures : [];
 		foreach (array_reverse($fixtures) as $f) {
 			if (isset($this->_loaded[$f])) {
 				$fixture = $this->_loaded[$f];
@@ -299,9 +298,6 @@ class FixtureManager {
 /**
  * Drop all fixture tables loaded by this class
  *
- * This will also close the session, as failing to do so will cause
- * fatal errors with database sessions.
- *
  * @return void
  */
 	public function shutDown() {
@@ -311,6 +307,7 @@ class FixtureManager {
 					$db = ConnectionManager::get($ds);
 					$fixture->drop($db);
 				}
+				$fixture->created = [];
 			}
 		}
 	}

+ 1 - 1
tests/TestCase/Database/ConnectionTest.php

@@ -123,7 +123,7 @@ class ConnectionTest extends TestCase {
  *
  * @return void
  **/
-	public function _testDisconnect() {
+	public function testDisconnect() {
 		$config = ConnectionManager::config('test');
 		ConnectionManager::config('test_disconnect', $config);
 		$this->connection = ConnectionManager::get('test_disconnect');