ErrorHandlerTest.php 720 B

1234567891011121314151617181920212223
  1. <?php
  2. use Codeception\Event\SuiteEvent;
  3. use Codeception\Lib\Notification;
  4. use Codeception\Subscriber\ErrorHandler;
  5. use Codeception\Suite;
  6. class ErrorHandlerTest extends \PHPUnit_Framework_TestCase
  7. {
  8. public function testDeprecationMessagesRespectErrorLevelSetting()
  9. {
  10. $errorHandler = new ErrorHandler();
  11. $suiteEvent = new SuiteEvent(new Suite(), null, ['error_level' => 'E_ERROR']);
  12. $errorHandler->handle($suiteEvent);
  13. Notification::all(); //clear the messages
  14. $errorHandler->errorHandler(E_USER_DEPRECATED, 'deprecated message', __FILE__, __LINE__, []);
  15. $this->assertEquals([], Notification::all(), 'Deprecation message was added to notifications');
  16. }
  17. }