diff --git a/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php b/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php index 22cfb1acb..314a41de7 100644 --- a/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php +++ b/lib/Cake/TestSuite/Fixture/CakeFixtureManager.php @@ -264,9 +264,15 @@ class CakeFixtureManager { /** * 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() { + if (session_id()) { + session_write_close(); + } foreach ($this->_loaded as $fixture) { if (!empty($fixture->created)) { foreach ($fixture->created as $ds) {