Skip to content

Commit

Permalink
zendframework#6366 - session validation should fail when the session …
Browse files Browse the repository at this point in the history
…holds invalid data

Signed-off-by: Marco Pivetta <[email protected]>
  • Loading branch information
Ocramius authored and weierophinney committed Jan 14, 2015
1 parent 712b654 commit 3fdc7ba
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/ZendTest/Session/SessionManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -604,4 +604,19 @@ public function testRemoteAddressValidationWillSucceedWithValidPreSetData()

$this->assertTrue($this->manager->isValid());
}

/**
* @runInSeparateProcess
*/
public function testRemoteAddressValidationWillFailWithInvalidPreSetData()
{
$_SESSION = array(
'__ZF' => array(
'_VALID' => array('Zend\Session\Validator\RemoteAddr' => '123.123.123.123'),
),
);

$this->setExpectedException('Zend\Session\Exception\RuntimeException', 'Session validation failed');
$this->manager->start();
}
}

0 comments on commit 3fdc7ba

Please sign in to comment.