From 763c3afb32793559ca7e5b22dbc5115bddd3d7e7 Mon Sep 17 00:00:00 2001 From: Chris Forrence Date: Tue, 21 Mar 2017 10:29:05 -0400 Subject: [PATCH] Split expectException calls with two parameters into the proper two calls --- tests/Monolog/Formatter/NormalizerFormatterTest.php | 6 ++++-- tests/Monolog/Handler/ElasticSearchHandlerTest.php | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/Monolog/Formatter/NormalizerFormatterTest.php b/tests/Monolog/Formatter/NormalizerFormatterTest.php index cbf8c3de..04a2472f 100644 --- a/tests/Monolog/Formatter/NormalizerFormatterTest.php +++ b/tests/Monolog/Formatter/NormalizerFormatterTest.php @@ -115,7 +115,8 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase public function testFormatToStringExceptionHandle() { $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([ 'myObject' => new TestToStringError(), ]); @@ -313,7 +314,8 @@ class NormalizerFormatterTest extends \PHPUnit_Framework_TestCase $reflMethod = new \ReflectionMethod($formatter, 'handleJsonError'); $reflMethod->setAccessible(true); - $this->expectException('RuntimeException', $msg); + $this->expectException('RuntimeException'); + $this->expectExceptionMessage($msg); $reflMethod->invoke($formatter, $code, 'faked'); } diff --git a/tests/Monolog/Handler/ElasticSearchHandlerTest.php b/tests/Monolog/Handler/ElasticSearchHandlerTest.php index fc915049..e0e207db 100644 --- a/tests/Monolog/Handler/ElasticSearchHandlerTest.php +++ b/tests/Monolog/Handler/ElasticSearchHandlerTest.php @@ -134,7 +134,8 @@ class ElasticSearchHandlerTest extends TestCase $handler = new ElasticSearchHandler($client, $handlerOpts); if ($expectedError) { - $this->expectException($expectedError[0], $expectedError[1]); + $this->expectException($expectedError[0]); + $this->expectExceptionMessage($expectedError[1]); $handler->handle($this->getRecord()); } else { $this->assertFalse($handler->handle($this->getRecord()));