lithium\tests\cases\storage\session\adapter\CookieTest::testReadDotSyntax PHP Method

testReadDotSyntax() public method

public testReadDotSyntax ( )
    public function testReadDotSyntax()
    {
        $key = 'read.test';
        $value = 'value to be read';
        $_COOKIE[$this->name]['read']['test'] = $value;
        $closure = $this->cookie->read($key);
        $this->assertTrue(is_callable($closure));
        $params = compact('key');
        $result = $closure($this->cookie, $params, null);
        $this->assertEqual($value, $result);
        $result = $closure($this->cookie, array('key' => null), null);
        $this->assertEqual($_COOKIE, $result);
        $key = 'does_not_exist';
        $closure = $this->cookie->read($key);
        $this->assertTrue(is_callable($closure));
        $params = compact('key');
        $result = $closure($this->cookie, $params, null);
        $this->assertNull($result);
    }