Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
zendframework/zendframework#6366 - session validation data should be …
Browse files Browse the repository at this point in the history
…preserved across requests

Signed-off-by: Marco Pivetta <ocramius@gmail.com>
  • Loading branch information
Ocramius authored and weierophinney committed Jan 14, 2015
1 parent 6b45f4c commit b190394
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/SessionManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use Zend\Session\SessionManager;
use Zend\Session;
use Zend\Session\Validator\RemoteAddr;

/**
* @group Zend_Session
Expand Down Expand Up @@ -535,4 +536,25 @@ public function testSessionWriteCloseStoresMetadata()
$this->assertSame($_SESSION['__ZF'], $metaData);
}

/**
* @runInSeparateProcess
*/
public function testValidatorChainSessionMetadataIsPreserved()
{
$this
->manager
->getValidatorChain()
->attach('session.validate', array(new RemoteAddr(), 'isValid'));

$this->assertFalse($this->manager->sessionExists());

$this->manager->start();

$this->assertSame(
array(
'Zend\Session\Validator\RemoteAddr' => '',
),
$_SESSION['__ZF']['_VALID']
);
}
}

0 comments on commit b190394

Please sign in to comment.