mirror of
https://github.com/Seldaek/monolog.git
synced 2025-06-11 03:20:54 +02:00
Fix SlackRecord normalization of fields, closes #1078
This commit is contained in:
@ -146,7 +146,7 @@ class SlackRecord
|
|||||||
|
|
||||||
if ($this->useShortAttachment) {
|
if ($this->useShortAttachment) {
|
||||||
$attachment['fields'][] = $this->generateAttachmentField(
|
$attachment['fields'][] = $this->generateAttachmentField(
|
||||||
ucfirst($key),
|
$key,
|
||||||
$record[$key]
|
$record[$key]
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
@ -241,7 +241,7 @@ class SlackRecord
|
|||||||
: $value;
|
: $value;
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
'title' => $title,
|
'title' => ucfirst($title),
|
||||||
'value' => $value,
|
'value' => $value,
|
||||||
'short' => false
|
'short' => false
|
||||||
);
|
);
|
||||||
|
@ -320,12 +320,12 @@ class SlackRecordTest extends TestCase
|
|||||||
'short' => false,
|
'short' => false,
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'title' => 'tags',
|
'title' => 'Tags',
|
||||||
'value' => sprintf('```%s```', json_encode($extra['tags'])),
|
'value' => sprintf('```%s```', json_encode($extra['tags'])),
|
||||||
'short' => false
|
'short' => false
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'title' => 'test',
|
'title' => 'Test',
|
||||||
'value' => $context['test'],
|
'value' => $context['test'],
|
||||||
'short' => false
|
'short' => false
|
||||||
)
|
)
|
||||||
@ -376,12 +376,12 @@ class SlackRecordTest extends TestCase
|
|||||||
|
|
||||||
$expected = array(
|
$expected = array(
|
||||||
array(
|
array(
|
||||||
'title' => 'info',
|
'title' => 'Info',
|
||||||
'value' => sprintf('```%s```', json_encode(array('author' => 'Jordi'), $this->jsonPrettyPrintFlag)),
|
'value' => sprintf('```%s```', json_encode(array('author' => 'Jordi'), $this->jsonPrettyPrintFlag)),
|
||||||
'short' => false
|
'short' => false
|
||||||
),
|
),
|
||||||
array(
|
array(
|
||||||
'title' => 'tags',
|
'title' => 'Tags',
|
||||||
'value' => sprintf('```%s```', json_encode(array('web'))),
|
'value' => sprintf('```%s```', json_encode(array('web'))),
|
||||||
'short' => false
|
'short' => false
|
||||||
),
|
),
|
||||||
|
Reference in New Issue
Block a user