File tree 3 files changed +26
-16
lines changed
src/Standards/Squiz/Tests/PHP
3 files changed +26
-16
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ $ str = <<<EOD
3
+ Example of string
4
+ spanning multiple lines
5
+ using heredoc syntax.
6
+ EOD ;
7
+
8
+ echo <<<'EOT'
9
+ My name is "$name". I am printing some $foo->foo.
10
+ Now, I am printing some {$foo->bar[1]}.
11
+ This should not print a capital 'A': \x41
12
+ EOT;
Original file line number Diff line number Diff line change 1
1
<?php
2
- $ str = <<<EOD
3
- Example of string
4
- spanning multiple lines
5
- using heredoc syntax.
6
- EOD ;
7
-
8
- echo <<<'EOT'
9
- My name is "$name". I am printing some $foo->foo.
10
- Now, I am printing some {$foo->bar[1]}.
11
- This should not print a capital 'A': \x41
12
- EOT;
13
2
3
+ // Intentional parse error.
14
4
// The following function has a simulated git conflict for testing.
15
5
// This is not a merge conflict - it is a valid test case.
16
6
// Please do not remove.
Original file line number Diff line number Diff line change @@ -26,14 +26,22 @@ class HeredocUnitTest extends AbstractSniffUnitTest
26
26
* The key of the array should represent the line number and the value
27
27
* should represent the number of errors that should occur on that line.
28
28
*
29
+ * @param string $testFile The name of the file being tested.
30
+ *
29
31
* @return array<int, int>
30
32
*/
31
- public function getErrorList ()
33
+ public function getErrorList ($ testFile = '' )
32
34
{
33
- return [
34
- 2 => 1 ,
35
- 8 => 1 ,
36
- ];
35
+ switch ($ testFile ) {
36
+ case 'HeredocUnitTest.1.inc ' :
37
+ return [
38
+ 2 => 1 ,
39
+ 8 => 1 ,
40
+ ];
41
+
42
+ default :
43
+ return [];
44
+ }//end switch
37
45
38
46
}//end getErrorList()
39
47
You can’t perform that action at this time.
0 commit comments