Skip to content

Commit d6f8958

Browse files
committed
Squiz/EmbeddedPhp: document behaviour for unclosed tag block with content at end of file
1 parent c2ee356 commit d6f8958

File tree

5 files changed

+51
-0
lines changed

5 files changed

+51
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
// This test case file MUST always start with a long open PHP tag set (with this comment) to prevent
3+
// the tests running into the "first PHP open tag excepted" condition breaking the tests.
4+
// Tests related to that "first PHP open tag excepted" condition should go in separate files.
5+
?>
6+
<!--
7+
The below test safeguards that if the last tag block is unclosed and has content, the sniff *will* kick in.
8+
-->
9+
<?php
10+
11+
12+
echo $incorrect_indent_and_too_many_blank_lines_above;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
// This test case file MUST always start with a long open PHP tag set (with this comment) to prevent
3+
// the tests running into the "first PHP open tag excepted" condition breaking the tests.
4+
// Tests related to that "first PHP open tag excepted" condition should go in separate files.
5+
?>
6+
<!--
7+
The below test safeguards that if the last tag block is unclosed and has content, the sniff *will* kick in.
8+
-->
9+
<?php
10+
echo $incorrect_indent_and_too_many_blank_lines_above;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?php
2+
// This test case file MUST always start with a long open PHP tag set (with this comment) to prevent
3+
// the tests running into the "first PHP open tag excepted" condition breaking the tests.
4+
// Tests related to that "first PHP open tag excepted" condition should go in separate files.
5+
?>
6+
<!--
7+
The below test safeguards that if the last tag block is unclosed and has content, the sniff *will* kick in.
8+
-->
9+
<?=
10+
11+
12+
$incorrect_indent_and_too_many_blank_lines_above
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
// This test case file MUST always start with a long open PHP tag set (with this comment) to prevent
3+
// the tests running into the "first PHP open tag excepted" condition breaking the tests.
4+
// Tests related to that "first PHP open tag excepted" condition should go in separate files.
5+
?>
6+
<!--
7+
The below test safeguards that if the last tag block is unclosed and has content, the sniff *will* kick in.
8+
-->
9+
<?=
10+
$incorrect_indent_and_too_many_blank_lines_above

src/Standards/Squiz/Tests/PHP/EmbeddedPhpUnitTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@ public function getErrorList($testFile='')
151151
42 => 1,
152152
];
153153

154+
case 'EmbeddedPhpUnitTest.12.inc':
155+
case 'EmbeddedPhpUnitTest.13.inc':
156+
return [
157+
10 => 1,
158+
12 => 1,
159+
];
160+
154161
default:
155162
return [];
156163
}//end switch

0 commit comments

Comments
 (0)