vendor/laravel/framework/src/Illuminate/Foundation/Testing/TestResponse.php
/**
     * Asserts that the response contains the given cookie and equals the optional value.
     *
     * @param  string  $cookieName
     * @param  mixed  $value
     * @param  bool  $encrypted
     * @return $this
     */
Asserts that the response contains the given cookie and equals the optional value.
@param  string  $cookieName
@param  mixed  $value
@param  bool  $encrypted
@return $this
Asserts that the response contains the given cookie and equals the optional value . @param string $cookieName @param mixed $value @param bool $encrypted @return $this
public function assertCookie($cookieName, $value = null, $encrypted = true)
    {
        PHPUnit::assertNotNull(
            $cookie = $this->getCookie($cookieName),
            "Cookie [{$cookieName}] not present on response."
        );
        if (! $cookie || is_null($value)) {
            return $this;
        }
        $cookieValue = $cookie->getValue();
        $actual = $encrypted
            ? app('encrypter')->decrypt($cookieValue) : $cookieValue;
        PHPUnit::assertEquals(
            $value, $actual,
            "Cookie [{$cookieName}] was found, but value [{$actual}] does not match [{$value}]."
        );
        return $this;
    }
public function assertCookie ( $ cookieName , $ value = null , $ encrypted = true ) { PHPUnit :: assertNotNull ( $ cookie = $ this -> getCookie ( $ cookieName ) , " Cookie [ { $ cookieName } ] not present on response. " ) ; if ( ! $ cookie || is_null ( $ value ) ) { return $ this ; } $ cookieValue = $ cookie -> getValue ( ) ; $ actual = $ encrypted ? app ( 'encrypter' ) -> decrypt ( $ cookieValue ) : $ cookieValue ; PHPUnit :: assertEquals ( $ value , $ actual , " Cookie [ { $ cookieName } ] was found, but value [ { $ actual } ] does not match [ { $ value } ]. " ) ; return $ this ; }
Asserts that the response contains the given cookie and equals the optional value.
Asserts that the response contains the given cookie and equals the optional value .