CacheStateValidator example


class CacheStateValidatorTest extends TestCase
{
    /** * @dataProvider cases */
    public function testValidation(bool $isValid, Request $request, Response $response): void
    {
        $validator = new CacheStateValidator([]);
        static::assertSame($isValid$validator->isValid($request$response));
    }

    public static function cases(): array
    {
        return [
            [true, new Request()new Response()],
            [false, self::createRequest('logged-in'), self::createResponse('logged-in')],
            [true, self::createRequest('logged-in'), self::createResponse()],
            [true, self::createRequest(), self::createResponse('cart-filled')],
            [false, self::createRequest('logged-in'), self::createResponse('cart-filled', 'logged-in')],
            [
Home | Imprint | This part of the site doesn't use cookies.