Skip to content

Commit

Permalink
Fixed test on earlier PHP versions
Browse files Browse the repository at this point in the history
  • Loading branch information
gsherwood committed Aug 7, 2013
1 parent 7c7493b commit 8bea4e8
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,18 @@ class Generic_Tests_PHP_ForbiddenFunctionsUnitTest extends AbstractSniffUnitTest
*/
public function getErrorList()
{
return array(
2 => 1,
4 => 1,
);
$errors = array(
2 => 1,
4 => 1,
);

// The trait insteadof test will only work in PHP versions where traits exist
// and will throw errors in earlier versions.
if (version_compare(PHP_VERSION, '5.4.0') < 0) {
$errors[44] = 2;
}

return $errors;

}//end getErrorList()

Expand Down

0 comments on commit 8bea4e8

Please sign in to comment.