From 3c74c7a8d2435344539bba0fd7089e7d3f54df2b Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 20 Mar 2017 11:12:52 +0100 Subject: [PATCH] Fix tests --- src/Monolog/Handler/Slack/SlackRecord.php | 2 +- tests/Monolog/Handler/Slack/SlackRecordTest.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Monolog/Handler/Slack/SlackRecord.php b/src/Monolog/Handler/Slack/SlackRecord.php index f4dd0e8e..d9e6a4cb 100644 --- a/src/Monolog/Handler/Slack/SlackRecord.php +++ b/src/Monolog/Handler/Slack/SlackRecord.php @@ -89,7 +89,7 @@ class SlackRecord { $this->channel = $channel; $this->username = $username; - $this->userIcon = trim($userIcon, ':'); + $this->userIcon = $userIcon !== null ? trim($userIcon, ':') : null; $this->useAttachment = $useAttachment; $this->useShortAttachment = $useShortAttachment; $this->includeContextAndExtra = $includeContextAndExtra; diff --git a/tests/Monolog/Handler/Slack/SlackRecordTest.php b/tests/Monolog/Handler/Slack/SlackRecordTest.php index e5c44d49..aa5787f7 100644 --- a/tests/Monolog/Handler/Slack/SlackRecordTest.php +++ b/tests/Monolog/Handler/Slack/SlackRecordTest.php @@ -172,7 +172,7 @@ class SlackRecordTest extends TestCase public function testTextEqualsFormatterOutput() { - $formatter = $this->getMock('Monolog\\Formatter\\FormatterInterface'); + $formatter = $this->createMock('Monolog\\Formatter\\FormatterInterface'); $formatter ->expects($this->any()) ->method('format') @@ -180,7 +180,7 @@ class SlackRecordTest extends TestCase return $record['message'] . 'test'; })); - $formatter2 = $this->getMock('Monolog\\Formatter\\FormatterInterface'); + $formatter2 = $this->createMock('Monolog\\Formatter\\FormatterInterface'); $formatter2 ->expects($this->any()) ->method('format')