123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace Composer\Test\Util;
- use Composer\Util\ErrorHandler;
- use Composer\Test\TestCase;
- class ErrorHandlerTest extends TestCase
- {
-
- public function testErrorHandlerCaptureNotice()
- {
- $this->setExpectedException('\ErrorException', 'Undefined index: baz');
- ErrorHandler::register();
- $array = array('foo' => 'bar');
- $array['baz'];
- }
-
- public function testErrorHandlerCaptureWarning()
- {
- $this->setExpectedException('\ErrorException', 'array_merge(): Argument #2 is not an array');
- ErrorHandler::register();
- array_merge(array(), 'string');
- }
-
- public function testErrorHandlerRespectsAtOperator()
- {
- ErrorHandler::register();
- @trigger_error('test', E_USER_NOTICE);
- }
- }
|