diff --git a/src/Monolog/Handler/Slack/SlackRecord.php b/src/Monolog/Handler/Slack/SlackRecord.php index 14325021..cb0b8717 100644 --- a/src/Monolog/Handler/Slack/SlackRecord.php +++ b/src/Monolog/Handler/Slack/SlackRecord.php @@ -99,7 +99,6 @@ class SlackRecord $dataArray = array( 'username' => $this->username, 'text' => '', - 'attachments' => array(), ); if ($this->channel) { diff --git a/tests/Monolog/Handler/Slack/SlackRecordTest.php b/tests/Monolog/Handler/Slack/SlackRecordTest.php index 351b92d3..d6c6c229 100644 --- a/tests/Monolog/Handler/Slack/SlackRecordTest.php +++ b/tests/Monolog/Handler/Slack/SlackRecordTest.php @@ -143,13 +143,12 @@ class SlackRecordTest extends TestCase $this->assertSame('', $data['text']); } - public function testAttachmentsEmptyIfNoAttachment() + public function testAttachmentsNotPresentIfNoAttachment() { $record = new SlackRecord($this->channel, 'Monolog', false); $data = $record->getSlackData($this->getRecord()); - $this->assertArrayHasKey('attachments', $data); - $this->assertSame(array(), $data['attachments']); + $this->assertArrayNotHasKey('attachments', $data); } public function testAddsOneAttachment()