Zend Framework

$_singleInstances are not cleaned up with namespaceUnset()

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.7.7
  • Fix Version/s: 1.8.2
  • Component/s: Zend_Session
  • Labels:
    None

Description

This is in my bootstrap (among other things):

class App
{
  public function __construct($env)
  {
  }

  public function start()
  {
    $foo = new Zend_Session_Namespace('foo', true);
    Zend_Registry::set('foo', $foo);
  }
}

My test case:

public function setUp()
{
  $boostrap = new App('testing');
  $this->bootstrap = array($bootstrap, 'start');
}

public function testIfIhaveLostMyFckingMind()
{
  // whatever here
}

public function testOHaiKthxBai()
{
  // something else
}

After I ran my test, Zend_Session::namespaceIsset('foo') reports "false" (test in tearDown() etc.) – so there should be no issue re-creating (= re-calling the bootstrap). But there is. Imho, the fix would be that Zend_Session::namespaceUnset() also cleans up in $_singleInstances.

This is the exception I get when it enters testOHaiKthxBai():

Zend_Session_Exception: A session namespace object already exists for this namespace ('foo'), and no additional accessors (session namespace objects) for this namespace are permitted.

Activity

Hide
Ralph Schindler added a comment -

Fixed in r15641

Show
Ralph Schindler added a comment - Fixed in r15641

People

Vote (2)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: