lithium\tests\integration\storage\SessionTest::testNamespacesWithPhpAdapter PHP Method

testNamespacesWithPhpAdapter() public method

    public function testNamespacesWithPhpAdapter()
    {
        $this->skipIf(PHP_SAPI === 'cli', 'No PHP session support in cli SAPI.');
        $config = array('name' => 'namespaceInt');
        Session::config(array($config['name'] => array('adapter' => 'Php')));
        Session::clear($config);
        $key1 = 'really.deep.nested.key';
        $value1 = 'nested_val';
        $key2 = 'shallow.key';
        $value2 = 'shallow_val';
        $this->assertTrue(Session::write($key1, $value1, $config));
        $this->assertTrue(Session::write($key2, $value2, $config));
        $this->assertEqual($value1, Session::read($key1, $config));
        $this->assertEqual($value2, Session::read($key2, $config));
        $expected = array('nested' => array('key' => $value1));
        $this->assertEqual($expected, Session::read('really.deep', $config));
    }