mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-07 13:46:38 +02:00
Split expectException calls with two parameters into the proper two calls
This commit is contained in:
@@ -115,7 +115,8 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
|
|||||||
public function testFormatToStringExceptionHandle()
|
public function testFormatToStringExceptionHandle()
|
||||||
{
|
{
|
||||||
$formatter = new NormalizerFormatter('Y-m-d');
|
$formatter = new NormalizerFormatter('Y-m-d');
|
||||||
$this->expectException('RuntimeException', 'Could not convert to string');
|
$this->expectException('RuntimeException');
|
||||||
|
$this->expectExceptionMessage('Could not convert to string');
|
||||||
$formatter->format([
|
$formatter->format([
|
||||||
'myObject' => new TestToStringError(),
|
'myObject' => new TestToStringError(),
|
||||||
]);
|
]);
|
||||||
@@ -313,7 +314,8 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase
|
|||||||
$reflMethod = new \ReflectionMethod($formatter, 'handleJsonError');
|
$reflMethod = new \ReflectionMethod($formatter, 'handleJsonError');
|
||||||
$reflMethod->setAccessible(true);
|
$reflMethod->setAccessible(true);
|
||||||
|
|
||||||
$this->expectException('RuntimeException', $msg);
|
$this->expectException('RuntimeException');
|
||||||
|
$this->expectExceptionMessage($msg);
|
||||||
$reflMethod->invoke($formatter, $code, 'faked');
|
$reflMethod->invoke($formatter, $code, 'faked');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -134,7 +134,8 @@ class ElasticSearchHandlerTest extends TestCase
|
|||||||
$handler = new ElasticSearchHandler($client, $handlerOpts);
|
$handler = new ElasticSearchHandler($client, $handlerOpts);
|
||||||
|
|
||||||
if ($expectedError) {
|
if ($expectedError) {
|
||||||
$this->expectException($expectedError[0], $expectedError[1]);
|
$this->expectException($expectedError[0]);
|
||||||
|
$this->expectExceptionMessage($expectedError[1]);
|
||||||
$handler->handle($this->getRecord());
|
$handler->handle($this->getRecord());
|
||||||
} else {
|
} else {
|
||||||
$this->assertFalse($handler->handle($this->getRecord()));
|
$this->assertFalse($handler->handle($this->getRecord()));
|
||||||
|
Reference in New Issue
Block a user