Example #1
0
 /**
  * @covers de\detert\sebastian\slimline\Session::validateSuperglobals
  * @covers de\detert\sebastian\slimline\Session::unsetSuperglobals
  * @covers de\detert\sebastian\slimline\Session::set
  * @covers de\detert\sebastian\slimline\Session::__destruct
  *
  * @runInSeparateProcess
  */
 public function testShouldSetAndGetSession()
 {
     session_start();
     $_SESSION['foo'] = 'test';
     $session = new Session();
     $session->unsetSuperglobals();
     $this->assertEquals(array(), $_SESSION);
     $filter = new Request_Filter();
     $filter->foo = array('scope' => array('SESSION'), 'filter' => FILTER_SANITIZE_STRING, 'options' => array());
     $actual = $session->getFilteredData($filter);
     $this->assertInstanceOf('de\\detert\\sebastian\\slimline\\Request_Filtered', $actual);
     $this->assertEquals('test', $actual->foo);
     $session->set('test', '123');
     unset($session);
     $this->assertEquals(array('foo' => 'test', 'test' => '123'), $_SESSION);
     session_destroy();
 }