toContain("header('Cache-Control: no-store, no-cache, must-revalidate');"); }); test('no second Cache-Control header overrides it', function () use ($globalSource) { expect(substr_count($globalSource, 'Cache-Control:'))->toBe(1); expect($globalSource)->not->toContain('max-age=31536000'); }); test('the surviving directive forbids storing the response', function () use ($globalSource) { preg_match_all("/header\('Cache-Control: ([^']+)'\);/", $globalSource, $matches); expect($matches[1])->toHaveCount(1); expect($matches[1][0])->toContain('no-store'); });