" . \' .'; seo()->{$method}($unsanitizedContent); $meta = meta(); $sanitizedContent = e($unsanitizedContent); // These assertions are equivalent, but included for clarity expect($meta)->not()->toContain('content="Testing string " with several \' XSS characters " . \' ."'); expect($meta)->not()->toContain("content=\"{$unsanitizedContent}\""); expect($meta)->toContain(""); expect($meta)->toContain(""); })->with([ ['site', 'og:site_name'], ['url', 'og:url'], ['image', 'og:image'], ['type', 'og:type'], ['locale', 'og:locale'], ]); // The Twitter integration is tested separately as it uses `meta name=""` instead of `meta property=""` test('the twitter extension properly sanitizes input', function (string $method, $property) { $unsanitizedContent = 'Testing string " with several \' XSS characters " . \' .'; seo()->{$method}($unsanitizedContent); $meta = meta(); $sanitizedContent = e($unsanitizedContent); // These assertions are equivalent, but included for clarity expect($meta)->not()->toContain('content="Testing string " with several \' XSS characters " . \' ."'); expect($meta)->not()->toContain("content=\"{$unsanitizedContent}\""); expect($meta)->toContain(""); expect($meta)->toContain(""); })->with([ ['twitterCreator', 'twitter:creator'], ['twitterSite', 'twitter:site'], ['twitterTitle', 'twitter:title'], ['twitterDescription', 'twitter:description'], ['twitterImage', 'twitter:image'], ]); // This method is tested separately as it adds an extra (