Unit tests fail in a nasty way if ErrorHandler test is run before the Silencer and it's not silencing itself.
parent
76c1645a0e
commit
2c3e7cf5f2
|
@ -29,12 +29,12 @@ class SilencerTest extends \PHPUnit_Framework_TestCase
|
||||||
|
|
||||||
// Check warnings are suppressed correctly
|
// Check warnings are suppressed correctly
|
||||||
Silencer::suppress();
|
Silencer::suppress();
|
||||||
trigger_error('Test', E_USER_WARNING);
|
@trigger_error('Test', E_USER_WARNING);
|
||||||
Silencer::restore();
|
Silencer::restore();
|
||||||
|
|
||||||
// Check all parameters and return values are passed correctly in a silenced call.
|
// Check all parameters and return values are passed correctly in a silenced call.
|
||||||
$result = Silencer::call(function($a, $b, $c) {
|
$result = Silencer::call(function($a, $b, $c) {
|
||||||
trigger_error('Test', E_USER_WARNING);
|
@trigger_error('Test', E_USER_WARNING);
|
||||||
return $a * $b * $c;
|
return $a * $b * $c;
|
||||||
}, 2, 3, 4);
|
}, 2, 3, 4);
|
||||||
$this->assertEquals(24, $result);
|
$this->assertEquals(24, $result);
|
||||||
|
|
Loading…
Reference in New Issue