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(
|
$dataArray = array(
|
||||||
'username' => $this->username,
|
'username' => $this->username,
|
||||||
'text' => '',
|
'text' => '',
|
||||||
'attachments' => array(),
|
|
||||||
);
|
);
|
||||||
|
|
||||||
if ($this->channel) {
|
if ($this->channel) {
|
||||||
|
@@ -143,13 +143,12 @@ class SlackRecordTest extends TestCase
|
|||||||
$this->assertSame('', $data['text']);
|
$this->assertSame('', $data['text']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAttachmentsEmptyIfNoAttachment()
|
public function testAttachmentsNotPresentIfNoAttachment()
|
||||||
{
|
{
|
||||||
$record = new SlackRecord($this->channel, 'Monolog', false);
|
$record = new SlackRecord($this->channel, 'Monolog', false);
|
||||||
$data = $record->getSlackData($this->getRecord());
|
$data = $record->getSlackData($this->getRecord());
|
||||||
|
|
||||||
$this->assertArrayHasKey('attachments', $data);
|
$this->assertArrayNotHasKey('attachments', $data);
|
||||||
$this->assertSame(array(), $data['attachments']);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testAddsOneAttachment()
|
public function testAddsOneAttachment()
|
||||||
|
Reference in New Issue
Block a user