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:
@@ -99,7 +99,6 @@ class SlackRecord
|
||||
$dataArray = array(
|
||||
'username' => $this->username,
|
||||
'text' => '',
|
||||
'attachments' => array(),
|
||||
);
|
||||
|
||||
if ($this->channel) {
|
||||
|
@@ -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()
|
||||
|
Reference in New Issue
Block a user