diff options
author | Anton Nizhegorodov <hookman.ru@gmail.com> | 2016-12-13 16:25:55 +0200 |
---|---|---|
committer | Jordi Boggiano <j.boggiano@seld.be> | 2016-12-13 15:25:55 +0100 |
commit | b732364e70a615231f15944e015b31d0d77bf9f5 (patch) | |
tree | dc506ea54d7f0ce47b92171f8ef36a651ad87e66 /tests/Monolog/Handler/SlackWebhookHandlerTest.php | |
parent | fdd6780ffd2f1aa1d7af7d6c69f186bf17d35cd4 (diff) | |
download | monolog-b732364e70a615231f15944e015b31d0d77bf9f5.zip monolog-b732364e70a615231f15944e015b31d0d77bf9f5.tar.gz monolog-b732364e70a615231f15944e015b31d0d77bf9f5.tar.bz2 |
Slack improvements (#894)
- [x] Exclude `extra`/`context`, `datetime`, `level` from message when attachment is used
- [x] Use `ts` attachment key to display `datetime` considering user timezone
- [x] [Support](https://github.com/Seldaek/monolog/pull/846#issuecomment-249528719) custom user images
- [x] [Allow](https://github.com/Seldaek/monolog/pull/894#issuecomment-263532399) to setup username from slack
- [x] [Improve](https://github.com/Seldaek/monolog/pull/846#issuecomment-261529198) array formatting within `context`/`extra`
- [x] [Support](https://github.com/Seldaek/monolog/issues/745) `include_stacktraces` option when attachment is not used and always include stacktraces when attachment is used
- [x] Support `extra`/`context` field exclusion
- [x] Update tests
Diffstat (limited to 'tests/Monolog/Handler/SlackWebhookHandlerTest.php')
-rw-r--r-- | tests/Monolog/Handler/SlackWebhookHandlerTest.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/Monolog/Handler/SlackWebhookHandlerTest.php b/tests/Monolog/Handler/SlackWebhookHandlerTest.php index cc9b7ba..c9229e2 100644 --- a/tests/Monolog/Handler/SlackWebhookHandlerTest.php +++ b/tests/Monolog/Handler/SlackWebhookHandlerTest.php @@ -32,11 +32,10 @@ class SlackWebhookHandlerTest extends TestCase public function testConstructorMinimal() { $handler = new SlackWebhookHandler(self::WEBHOOK_URL); + $record = $this->getRecord(); $slackRecord = $handler->getSlackRecord(); $this->assertInstanceOf('Monolog\Handler\Slack\SlackRecord', $slackRecord); $this->assertEquals(array( - 'username' => 'Monolog', - 'text' => '', 'attachments' => array( array( 'fallback' => 'test', @@ -46,13 +45,15 @@ class SlackWebhookHandlerTest extends TestCase array( 'title' => 'Level', 'value' => 'WARNING', - 'short' => true, + 'short' => false, ), ), 'title' => 'Message', + 'mrkdwn_in' => array('fields'), + 'ts' => $record['datetime']->getTimestamp(), ), ), - ), $slackRecord->getSlackData($this->getRecord())); + ), $slackRecord->getSlackData($record)); } /** |