Skip to content

Commit

Permalink
[WIP]
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverklee authored and JakeQZ committed Mar 23, 2021
1 parent a9d7a71 commit 1efffbb
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/Unit/HtmlProcessor/AbstractHtmlProcessorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -435,12 +435,19 @@ public function provideContentWithoutHeadTag(): array
'body content only' => ['<p>Hello</p>'],
'BODY element' => ['<body></body>'],
'HEADER element' => ['<header></header>'],
'META element (implicit HEAD)' => ['<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'],
'http-equiv META element (implicit HEAD)'
=> ['<meta http-equiv="Content-Type" content="text/html; charset=utf-8">'],
'viewport META element (implicit HEAD)'
=> ['<meta name="viewport" content="width=device-width, initial-scale=1.0">'],
'META element with Content-Type as a value' => ['<meta name="description" content="Content-Type">'],
'BODY element with Content-Type in text' => ['<body>Content-Type</body>'],
'body content only with Content-Type in text' => ['<p>Content-Type</p>'],
// broken: BODY element containing Content-Type META tag
// broken: body content only with Content-Type META tag
'http-equiv META element within P (not allowed)'
=> ['<p><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></p>'],
'viewport META element within P (allowed)'
=> ['<p><meta name="viewport" content="width=device-width, initial-scale=1.0"></p>'],
];
}

Expand All @@ -451,7 +458,7 @@ public function provideContentWithoutHeadTag(): array
*
* @dataProvider provideContentWithoutHeadTag
*/
public function addsMissingHeadTagOnlyOnce(string $html): void
public function addsMissingHeadTagExactlyOnce(string $html): void
{
$subject = TestingHtmlProcessor::fromHtml($html);

Expand Down

0 comments on commit 1efffbb

Please sign in to comment.