Fix error reporting tests that broke due to an E_NOTICE becoming an E_WARNING
I decided to patch over this rather than re-write the tests as they can easily become E_WARNING once we drop PHP 7
MODIFY
features/bootstrap/FeatureContext.php
features/bootstrap/FeatureContext.php
@@ -438,6 +438,9 @@ EOL;
// Replace wrong warning message of HHVM
$output = str_replace('Notice: Undefined index: ', 'Notice: Undefined offset: ', $output);
+ // replace error message that changed in PHP
+ $output = str_replace('Warning: Undefined array key','Notice: Undefined offset:', $output);
+
return trim(preg_replace("/ +$/m", '', $output));
}

MODIFY
features/error_reporting.feature
features/error_reporting.feature
@@ -111,12 +111,12 @@ Feature: Error Reporting
7 steps (5 passed, 1 failed, 1 skipped)
"""
- Scenario: With error reporting ignoring E_NOTICE
+ Scenario: With error reporting ignoring E_NOTICE and E_WARNING
Given a file named "behat.yml" with:
"""
default:
calls:
- error_reporting: 32759
+ error_reporting: 32757
"""
When I run "behat -f progress --no-colors features/e_notice_in_scenario.feature"
Then it should pass

Fix error reporting tests that broke due to an E_NOTICE becoming an E_WARNING

I decided to patch over this rather than re-write the tests as they can easily become E_WARNING once we drop PHP 7