26 const WEBHOOK_URL =
'https://hooks.slack.com/services/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E';
36 $slackRecord =
$handler->getSlackRecord();
37 $this->assertInstanceOf(
'Monolog\Handler\Slack\SlackRecord', $slackRecord);
38 $this->assertEquals(array(
39 'attachments' => array(
52 'mrkdwn_in' => array(
'fields'),
53 'ts' => $record[
'datetime']->getTimestamp(),
56 ), $slackRecord->getSlackData($record));
77 $slackRecord =
$handler->getSlackRecord();
78 $this->assertInstanceOf(
'Monolog\Handler\Slack\SlackRecord', $slackRecord);
79 $this->assertEquals(array(
80 'username' =>
'test-username',
82 'channel' =>
'test-channel',
83 'icon_emoji' =>
':ghost:',
84 ), $slackRecord->getSlackData($this->getRecord()));
93 $formatter =
$handler->getFormatter();
94 $this->assertInstanceOf(
'Monolog\Formatter\FormatterInterface', $formatter);
105 $this->assertSame($formatter,
$handler->getFormatter());
An exception for terminatinating execution or to throw for unit testing.
testConstructorMinimal()
@covers ::__construct @covers ::getSlackRecord
testSetFormatter()
@covers ::setFormatter
testConstructorFull()
@covers ::__construct @covers ::getSlackRecord
testGetFormatter()
@covers ::getFormatter
Sends notifications through Slack Webhooks.
Slack record utility helping to log to Slack webhooks or API.
const DEBUG
Detailed debug information.
getRecord($level=Logger::WARNING, $message='test', $context=array())