Skip to content

Commit

Permalink
[TASK] Add test for keeping curly braces in text nodes (#647)
Browse files Browse the repository at this point in the history
The new test shows that issue #646 only affects attribute values, not text
nodes.
  • Loading branch information
oliverklee authored and JakeQZ committed Jan 2, 2019
1 parent 8ee7fb5 commit e9446cf
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 3 additions & 2 deletions tests/Unit/CssInlinerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ public function specialCharactersDataProvider()
'template markers with dollar signs & square brackets' => ['$[USER:NAME]$'],
'UTF-8 umlauts' => ['Küss die Hand, schöne Frau.'],
'HTML entities' => ['a & b > c'],
'curly braces' => ['{Happy new year!}'],
];
}

Expand All @@ -268,7 +269,7 @@ public function specialCharactersDataProvider()
*
* @dataProvider specialCharactersDataProvider
*/
public function renderKeepsSpecialCharacters($codeNotToBeChanged)
public function renderKeepsSpecialCharactersInTextNodes($codeNotToBeChanged)
{
$html = '<html><p>' . $codeNotToBeChanged . '</p></html>';
$subject = $this->buildDebugSubject($html);
Expand Down Expand Up @@ -297,7 +298,7 @@ public function addsMissingHtml5DocumentType()
*
* @dataProvider specialCharactersDataProvider
*/
public function emogrifyBodyContentKeepsSpecialCharacters($codeNotToBeChanged)
public function emogrifyBodyContentKeepsSpecialCharactersInTextNodes($codeNotToBeChanged)
{
$html = '<html><p>' . $codeNotToBeChanged . '</p></html>';
$subject = $this->buildDebugSubject($html);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ public function specialCharactersDataProvider()
'template markers with dollar signs & square brackets' => ['$[USER:NAME]$'],
'UTF-8 umlauts' => ['Küss die Hand, schöne Frau.'],
'HTML entities' => ['a &amp; b &gt; c'],
'curly braces' => ['{Happy new year!}'],
];
}

Expand All @@ -214,7 +215,7 @@ public function specialCharactersDataProvider()
*
* @dataProvider specialCharactersDataProvider
*/
public function keepsSpecialCharacters($codeNotToBeChanged)
public function keepsSpecialCharactersInTextNodes($codeNotToBeChanged)
{
$html = '<html><p>' . $codeNotToBeChanged . '</p></html>';
$subject = new TestingHtmlProcessor($html);
Expand Down
5 changes: 3 additions & 2 deletions tests/Unit/EmogrifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ public function specialCharactersDataProvider()
'template markers with dollar signs & square brackets' => ['$[USER:NAME]$'],
'UTF-8 umlauts' => ['Küss die Hand, schöne Frau.'],
'HTML entities' => ['a &amp; b &gt; c'],
'curly braces' => ['{Happy new year!}'],
];
}

Expand All @@ -240,7 +241,7 @@ public function specialCharactersDataProvider()
*
* @dataProvider specialCharactersDataProvider
*/
public function emogrifyKeepsSpecialCharacters($codeNotToBeChanged)
public function emogrifyKeepsSpecialCharactersInTextNodes($codeNotToBeChanged)
{
$html = '<html><p>' . $codeNotToBeChanged . '</p></html>';
$this->subject->setHtml($html);
Expand All @@ -257,7 +258,7 @@ public function emogrifyKeepsSpecialCharacters($codeNotToBeChanged)
*
* @dataProvider specialCharactersDataProvider
*/
public function emogrifyBodyContentKeepsSpecialCharacters($codeNotToBeChanged)
public function emogrifyBodyContentKeepsSpecialCharactersInTextNodes($codeNotToBeChanged)
{
$html = '<html><p>' . $codeNotToBeChanged . '</p></html>';
$this->subject->setHtml($html);
Expand Down

0 comments on commit e9446cf

Please sign in to comment.