Skip to content

Commit a9642e5

Browse files
rodrigoprimojrfnl
authored andcommitted
Generic/ByteOrderMark: improve test coverage
This commit adds four more tests case files: * 2 to cover the cases where the sniff is triggered but the file does not contain a BOM character. One of these files is in UTF-8 encoding without a BOM, the other is in ANSI/iso-8859-1 encoding. * 2 to cover the different UTF-16 encodings with a BOM character. Includes adding a comment to the original test case file to document the encoding (UTF-8 with BOM) of that file.
1 parent 39b2fed commit a9642e5

File tree

6 files changed

+10
-3
lines changed

6 files changed

+10
-3
lines changed
Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
<?php
2-
echo 'foo';
3-
?>
1+
<?php
2+
// File in UTF-8 encoding with byte order mark (BOM) character before the opening PHP tag.
3+
echo 'foo';
4+
?>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php // File in UTF-8 encoding without a byte order mark (BOM) character before the opening PHP tag. ?>
2+
3+
<p>Some HTML</p>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<p>Some HTML at the beginning of an ANSI/iso-8859-1 encoded file without a byte order mark (BOM) character</p>
Binary file not shown.
Binary file not shown.

src/Standards/Generic/Tests/Files/ByteOrderMarkUnitTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ public function getErrorList($testFile='')
3434
{
3535
switch ($testFile) {
3636
case 'ByteOrderMarkUnitTest.1.inc':
37+
case 'ByteOrderMarkUnitTest.4.inc':
38+
case 'ByteOrderMarkUnitTest.5.inc':
3739
return [1 => 1];
3840

3941
default:

0 commit comments

Comments
 (0)