Jordi Boggiano 8 лет назад
Родитель
Сommit
3c74c7a8d2

+ 1 - 1
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;

+ 2 - 2
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')