1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <?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);
- }
- }
|