Skip to content

Commit 654f6d1

Browse files
committed
Add test for unescaped attributes
1 parent 2265766 commit 654f6d1

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

tests/Phug/Compiler/AttributeCompilerTest.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,26 @@ public function testCompile()
6161
);
6262
}
6363

64+
/**
65+
* @covers ::<public>
66+
*/
67+
public function testUnescapedAttributes()
68+
{
69+
$this->assertRenderFile(
70+
[
71+
'<script type="text/x-template">'.PHP_EOL,
72+
' <div id="user-<%= user.id %>">'.PHP_EOL,
73+
' <h1><%= user.title %></h1>'.PHP_EOL,
74+
' </div>'.PHP_EOL,
75+
'</script>'.PHP_EOL,
76+
],
77+
__DIR__.'/../../templates/attrs.unescaped.pug',
78+
[
79+
'pretty' => ' ',
80+
]
81+
);
82+
}
83+
6484
/**
6585
* @covers ::<public>
6686
* @expectedException \Phug\CompilerException
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
script(type='text/x-template')
2+
div(id!='user-<%= user.id %>')
3+
h1 <%= user.title %>

0 commit comments

Comments
 (0)