From 6a27a9fddd8f5b12b3af0de6309181ff5946dd0e Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Sun, 28 Dec 2014 20:43:50 +0100 Subject: [PATCH] zendframework/zf2#6366 - session validation should fail when the session holds invalid data Signed-off-by: Marco Pivetta --- test/SessionManagerTest.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/SessionManagerTest.php b/test/SessionManagerTest.php index b6769ae3..fed7af63 100644 --- a/test/SessionManagerTest.php +++ b/test/SessionManagerTest.php @@ -587,4 +587,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(); + } }