Permalink
Browse files

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
  • Loading branch information...
markstory committed Mar 9, 2013
1 parent 3b7b322 commit 0ba1aa6d386c1b2048a4cbcde57d15c6a7f74853
Showing with 6 additions and 0 deletions.
  1. +6 −0 lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
@@ -264,9 +264,15 @@ public function loadSingle($name, $db = null) {
/**
* 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) {

0 comments on commit 0ba1aa6

Please sign in to comment.