Unit tests fail in a nasty way if ErrorHandler test is run before the Silencer and it's not silencing itself.

main
Niels Keurentjes 9 years ago
parent 76c1645a0e
commit 2c3e7cf5f2

@ -29,12 +29,12 @@ class SilencerTest extends \PHPUnit_Framework_TestCase
// Check warnings are suppressed correctly
Silencer::suppress();
trigger_error('Test', E_USER_WARNING);
@trigger_error('Test', E_USER_WARNING);
Silencer::restore();
// Check all parameters and return values are passed correctly in a silenced call.
$result = Silencer::call(function($a, $b, $c) {
trigger_error('Test', E_USER_WARNING);
@trigger_error('Test', E_USER_WARNING);
return $a * $b * $c;
}, 2, 3, 4);
$this->assertEquals(24, $result);

Loading…
Cancel
Save