1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-08-05 04:37:38 +02:00

Do not put empty Slack attachments array by default

This commit is contained in:
Haralan Dobrev
2016-11-19 13:39:27 +02:00
parent 8b2b13546e
commit 26b526d9fb
2 changed files with 2 additions and 4 deletions

View File

@@ -99,7 +99,6 @@ class SlackRecord
$dataArray = array(
'username' => $this->username,
'text' => '',
'attachments' => array(),
);
if ($this->channel) {

View File

@@ -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()