Skip to content

Commit

Permalink
Close the session out before erasing all the fixtures.
Browse files Browse the repository at this point in the history
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 0ba1aa6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/Cake/TestSuite/Fixture/CakeFixtureManager.php
Expand Up @@ -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) {
Expand Down

0 comments on commit 0ba1aa6

Please sign in to comment.