lithium\tests\cases\storage\session\adapter\CookieTest::testRead PHP Метод

testRead() публичный Метод

public testRead ( )
    public function testRead()
    {
        $key = 'read';
        $value = 'value to be read';
        $_COOKIE[$this->name][$key] = $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);
    }