init
This commit is contained in:
26
vendor/codeception/base/tests/unit/Codeception/Subscriber/ErrorHandlerTest.php
vendored
Normal file
26
vendor/codeception/base/tests/unit/Codeception/Subscriber/ErrorHandlerTest.php
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
use Codeception\Event\SuiteEvent;
|
||||
use Codeception\Lib\Notification;
|
||||
use Codeception\Subscriber\ErrorHandler;
|
||||
use Codeception\Suite;
|
||||
|
||||
class ErrorHandlerTest extends \PHPUnit\Framework\TestCase
|
||||
{
|
||||
|
||||
public function testDeprecationMessagesRespectErrorLevelSetting()
|
||||
{
|
||||
$errorHandler = new ErrorHandler();
|
||||
|
||||
$suiteEvent = new SuiteEvent(new Suite(), null, ['error_level' => 'E_ERROR']);
|
||||
$errorHandler->handle($suiteEvent);
|
||||
|
||||
//Satisfying The Premature Exit Handling
|
||||
$errorHandler->onFinish($suiteEvent);
|
||||
|
||||
Notification::all(); //clear the messages
|
||||
$errorHandler->errorHandler(E_USER_DEPRECATED, 'deprecated message', __FILE__, __LINE__, []);
|
||||
|
||||
$this->assertEquals([], Notification::all(), 'Deprecation message was added to notifications');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user