Skip to content

Commit 3c74c7a

Browse files
committed
Fix tests
1 parent ca17a62 commit 3c74c7a

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Monolog/Handler/Slack/SlackRecord.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function __construct($channel = null, $username = null, $useAttachment =
8989
{
9090
$this->channel = $channel;
9191
$this->username = $username;
92-
$this->userIcon = trim($userIcon, ':');
92+
$this->userIcon = $userIcon !== null ? trim($userIcon, ':') : null;
9393
$this->useAttachment = $useAttachment;
9494
$this->useShortAttachment = $useShortAttachment;
9595
$this->includeContextAndExtra = $includeContextAndExtra;

tests/Monolog/Handler/Slack/SlackRecordTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,15 +172,15 @@ public function testTextEqualsMessageIfNoAttachment()
172172

173173
public function testTextEqualsFormatterOutput()
174174
{
175-
$formatter = $this->getMock('Monolog\\Formatter\\FormatterInterface');
175+
$formatter = $this->createMock('Monolog\\Formatter\\FormatterInterface');
176176
$formatter
177177
->expects($this->any())
178178
->method('format')
179179
->will($this->returnCallback(function ($record) {
180180
return $record['message'] . 'test';
181181
}));
182182

183-
$formatter2 = $this->getMock('Monolog\\Formatter\\FormatterInterface');
183+
$formatter2 = $this->createMock('Monolog\\Formatter\\FormatterInterface');
184184
$formatter2
185185
->expects($this->any())
186186
->method('format')

0 commit comments

Comments
 (0)