lithium\tests\cases\storage\session\adapter\PhpTest::testCheck PHP Method

testCheck() public method

public testCheck ( )
    public function testCheck()
    {
        $this->php->read();
        $key = 'read';
        $value = 'value to be read';
        $_SESSION[$key] = $value;
        $closure = $this->php->check($key);
        $this->assertInternalType('callable', $closure);
        $params = compact('key');
        $result = $closure($this->php, $params, null);
        $this->assertTrue($result);
        $key = 'does_not_exist';
        $closure = $this->php->check($key);
        $this->assertInternalType('callable', $closure);
        $params = compact('key');
        $result = $closure($this->php, $params, null);
        $this->assertFalse($result);
    }