Skip to content

Commit ac4987e

Browse files
authored
Merge pull request #542 from biinari/chore/143-Generic_CodeAnalysis_UnconditionalIfStatement_separate_parse_error
Generic/CodeAnalysis/UnconditionalIfStatement: move parse error to its own file
2 parents 3d55d71 + cc1a14e commit ac4987e

File tree

3 files changed

+18
-10
lines changed

3 files changed

+18
-10
lines changed

src/Standards/Generic/Tests/CodeAnalysis/UnconditionalIfStatementUnitTest.inc renamed to src/Standards/Generic/Tests/CodeAnalysis/UnconditionalIfStatementUnitTest.1.inc

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,3 @@ if (true) {
1111
if (file_exists(__FILE__) === true) {
1212

1313
}
14-
15-
// Intentional parse error/live coding.
16-
// This needs to be the last test in the file.
17-
if(true
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
3+
// Intentional parse error. Live coding resilience.
4+
if(true

src/Standards/Generic/Tests/CodeAnalysis/UnconditionalIfStatementUnitTest.php

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,23 @@ public function getErrorList()
4141
* The key of the array should represent the line number and the value
4242
* should represent the number of warnings that should occur on that line.
4343
*
44+
* @param string $testFile The name of the file being tested.
45+
*
4446
* @return array<int, int>
4547
*/
46-
public function getWarningList()
48+
public function getWarningList($testFile='')
4749
{
48-
return [
49-
3 => 1,
50-
5 => 1,
51-
7 => 1,
52-
];
50+
switch ($testFile) {
51+
case 'UnconditionalIfStatementUnitTest.1.inc':
52+
return [
53+
3 => 1,
54+
5 => 1,
55+
7 => 1,
56+
];
57+
58+
default:
59+
return [];
60+
}//end switch
5361

5462
}//end getWarningList()
5563

0 commit comments

Comments
 (0)