Skip to content

Commit efb9e44

Browse files
committed
Squiz/EmbeddedPhp: add test safeguarding handling of blank lines and scope closers
1 parent e9e2011 commit efb9e44

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.1.inc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,17 @@ Safeguard closing tag indent calculation for when the last content on the close
188188
<?php
189189
} ?>
190190

191+
<!--
192+
Safeguard that blank lines between a PHP tag and a scope closer are not touched as the scope closer may have its own rules.
193+
-->
194+
<?php if ($foo) { ?>
195+
<tr></tr>
196+
<?php
197+
198+
199+
}
200+
?>
201+
191202
<?php
192203
// This test case file MUST always end with an unclosed long open PHP tag (with this comment) to prevent
193204
// the tests running into the "last PHP closing tag excepted" condition breaking tests.

src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.1.inc.fixed

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,17 @@ Safeguard closing tag indent calculation for when the last content on the close
190190
}
191191
?>
192192

193+
<!--
194+
Safeguard that blank lines between a PHP tag and a scope closer are not touched as the scope closer may have its own rules.
195+
-->
196+
<?php if ($foo) { ?>
197+
<tr></tr>
198+
<?php
199+
200+
201+
}
202+
?>
203+
193204
<?php
194205
// This test case file MUST always end with an unclosed long open PHP tag (with this comment) to prevent
195206
// the tests running into the "last PHP closing tag excepted" condition breaking tests.

0 commit comments

Comments
 (0)