lithium\test\Unit::assertCookie PHP Метод

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

The value passed to exepected is an array of the cookie data, with at least the key and value expected, but can support any of the following keys: - key: the expected key - value: the expected value - path: optionally specifiy a path - name: optionally specify the cookie name - expires: optionally assert a specific expire time
См. также: lithium\test\Unit::assert()
public assertCookie ( array $expected, array $headers = null ) : boolean
$expected array
$headers array When empty, value of `headers_list()` is used.
Результат boolean `true` if the assertion succeeded, `false` otherwise.
    public function assertCookie($expected, $headers = null)
    {
        $matched = $this->_cookieMatch($expected, $headers);
        if (!$matched['match']) {
            $message = sprintf('%s - Cookie not found in headers.', $matched['pattern']);
            return $this->assert(false, $message, compact('expected', 'result'));
        }
        return $this->assert(true, '%s');
    }