mirror of
https://github.com/Seldaek/monolog.git
synced 2025-07-31 18:30:15 +02:00
Replace deprecated setExpectedException methods with expectException
This commit is contained in:
@@ -115,7 +115,7 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
public function testFormatToStringExceptionHandle()
|
||||
{
|
||||
$formatter = new NormalizerFormatter('Y-m-d');
|
||||
$this->setExpectedException('RuntimeException', 'Could not convert to string');
|
||||
$this->expectException('RuntimeException', 'Could not convert to string');
|
||||
$formatter->format([
|
||||
'myObject' => new TestToStringError(),
|
||||
]);
|
||||
@@ -313,7 +313,7 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
|
||||
$reflMethod = new \ReflectionMethod($formatter, 'handleJsonError');
|
||||
$reflMethod->setAccessible(true);
|
||||
|
||||
$this->setExpectedException('RuntimeException', $msg);
|
||||
$this->expectException('RuntimeException', $msg);
|
||||
$reflMethod->invoke($formatter, $code, 'faked');
|
||||
}
|
||||
|
||||
|
@@ -134,7 +134,7 @@ class ElasticSearchHandlerTest extends TestCase
|
||||
$handler = new ElasticSearchHandler($client, $handlerOpts);
|
||||
|
||||
if ($expectedError) {
|
||||
$this->setExpectedException($expectedError[0], $expectedError[1]);
|
||||
$this->expectException($expectedError[0], $expectedError[1]);
|
||||
$handler->handle($this->getRecord());
|
||||
} else {
|
||||
$this->assertFalse($handler->handle($this->getRecord()));
|
||||
|
@@ -38,7 +38,7 @@ class SyslogHandlerTest extends \PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testConstructInvalidFacility()
|
||||
{
|
||||
$this->setExpectedException('UnexpectedValueException');
|
||||
$this->expectException('UnexpectedValueException');
|
||||
$handler = new SyslogHandler('test', 'unknown');
|
||||
}
|
||||
}
|
||||
|
@@ -68,7 +68,7 @@ class RegistryTest extends \PHPUnit_Framework_TestCase
|
||||
Registry::addLogger(new Logger('test1'), 'log');
|
||||
Registry::clear();
|
||||
|
||||
$this->setExpectedException('\InvalidArgumentException');
|
||||
$this->expectException('\InvalidArgumentException');
|
||||
Registry::getInstance('log');
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ class RegistryTest extends \PHPUnit_Framework_TestCase
|
||||
Registry::addLogger($loggerToAdd);
|
||||
Registry::removeLogger($remove);
|
||||
|
||||
$this->setExpectedException('\InvalidArgumentException');
|
||||
$this->expectException('\InvalidArgumentException');
|
||||
Registry::getInstance($loggerToAdd->getName());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user