From 0ba1aa6d386c1b2048a4cbcde57d15c6a7f74853 Mon Sep 17 00:00:00 2001 From: mark_story Date: Fri, 8 Mar 2013 20:55:44 -0500 Subject: [PATCH] Close the session out before erasing all the fixtures. Not closing the session before closing fixtures results in fatal errors when using database sessions. Fixes #3683 --- lib/Cake/TestSuite/Fixture/CakeFixtureManager.php | 6 ++++++ 1 file changed, 6 insertions(+) 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) {