diff options
author | Derek Clapham <derek.clapham@photomerchant.net> | 2014-08-22 15:19:14 +1000 |
---|---|---|
committer | Derek Clapham <derek.clapham@photomerchant.net> | 2014-08-22 15:19:14 +1000 |
commit | c63d082444f66c143a80d648e8f8573b062d5b81 (patch) | |
tree | fc10e676f20fea82f235cd5edfc3144661d74dcf /tests/Monolog/Handler/SlackHandlerTest.php | |
parent | 12545cda2f7a0bd82a110f742ef455fe735e60cf (diff) | |
download | monolog-c63d082444f66c143a80d648e8f8573b062d5b81.zip monolog-c63d082444f66c143a80d648e8f8573b062d5b81.tar.gz monolog-c63d082444f66c143a80d648e8f8573b062d5b81.tar.bz2 |
Added emoji support as per slack api doc: https://api.slack.com/methods/chat.postMessage
Diffstat (limited to 'tests/Monolog/Handler/SlackHandlerTest.php')
-rw-r--r-- | tests/Monolog/Handler/SlackHandlerTest.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/Monolog/Handler/SlackHandlerTest.php b/tests/Monolog/Handler/SlackHandlerTest.php index 943c466..4efeca7 100644 --- a/tests/Monolog/Handler/SlackHandlerTest.php +++ b/tests/Monolog/Handler/SlackHandlerTest.php @@ -54,7 +54,7 @@ class SlackHandlerTest extends TestCase fseek($this->res, 0); $content = fread($this->res, 1024); - $this->assertRegexp('/token=myToken&channel=channel1&username=Monolog&text=&attachments=.*$/', $content); + $this->assertRegexp('/token=myToken&channel=channel1&username=Monolog&icon_emoji=%3Aalien%3A&text=&attachments=.*$/', $content); } /** @@ -72,7 +72,7 @@ class SlackHandlerTest extends TestCase public function testWriteContentWithPlainTextMessage() { - $this->createHandler('myToken', 'channel1', 'Monolog', false); + $this->createHandler('myToken', 'channel1', 'Monolog', 'alien', false); $this->handler->handle($this->getRecord(Logger::CRITICAL, 'test1')); fseek($this->res, 0); $content = fread($this->res, 1024); @@ -94,9 +94,9 @@ class SlackHandlerTest extends TestCase ); } - private function createHandler($token = 'myToken', $channel = 'channel1', $username = 'Monolog', $useAttachment = true) + private function createHandler($token = 'myToken', $channel = 'channel1', $username = 'Monolog', $iconEmoji = 'alien', $useAttachment = true) { - $constructorArgs = array($token, $channel, $username, $useAttachment, Logger::DEBUG, true); + $constructorArgs = array($token, $channel, $username, $iconEmoji, $useAttachment, Logger::DEBUG, true); $this->res = fopen('php://memory', 'a'); $this->handler = $this->getMock( '\Monolog\Handler\SlackHandler', |