|
@@ -20,6 +20,16 @@ use Composer\Test\TestCase;
|
|
|
*/
|
|
|
class ErrorHandlerTest extends TestCase
|
|
|
{
|
|
|
+ public function setUp()
|
|
|
+ {
|
|
|
+ ErrorHandler::register();
|
|
|
+ }
|
|
|
+
|
|
|
+ public function tearDown()
|
|
|
+ {
|
|
|
+ restore_error_handler();
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Test ErrorHandler handles notices
|
|
|
*/
|
|
@@ -27,8 +37,6 @@ class ErrorHandlerTest extends TestCase
|
|
|
{
|
|
|
$this->setExpectedException('\ErrorException', 'Undefined index: baz');
|
|
|
|
|
|
- ErrorHandler::register();
|
|
|
-
|
|
|
$array = array('foo' => 'bar');
|
|
|
$array['baz'];
|
|
|
}
|
|
@@ -40,18 +48,15 @@ class ErrorHandlerTest extends TestCase
|
|
|
{
|
|
|
$this->setExpectedException('\ErrorException', 'array_merge');
|
|
|
|
|
|
- ErrorHandler::register();
|
|
|
-
|
|
|
array_merge(array(), 'string');
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* Test ErrorHandler handles warnings
|
|
|
+ * @doesNotPerformAssertions
|
|
|
*/
|
|
|
public function testErrorHandlerRespectsAtOperator()
|
|
|
{
|
|
|
- ErrorHandler::register();
|
|
|
-
|
|
|
@trigger_error('test', E_USER_NOTICE);
|
|
|
}
|
|
|
}
|