Skip to content

Commit 00aca28

Browse files
committed
Fix SlackRecord normalization of fields, closes #1078
1 parent 0d993d8 commit 00aca28

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Monolog/Handler/Slack/SlackRecord.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ public function getSlackData(array $record)
146146

147147
if ($this->useShortAttachment) {
148148
$attachment['fields'][] = $this->generateAttachmentField(
149-
ucfirst($key),
149+
$key,
150150
$record[$key]
151151
);
152152
} else {
@@ -241,7 +241,7 @@ private function generateAttachmentField($title, $value)
241241
: $value;
242242

243243
return array(
244-
'title' => $title,
244+
'title' => ucfirst($title),
245245
'value' => $value,
246246
'short' => false
247247
);

tests/Monolog/Handler/Slack/SlackRecordTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -320,12 +320,12 @@ public function testAddsLongAttachmentWithContextAndExtra()
320320
'short' => false,
321321
),
322322
array(
323-
'title' => 'tags',
323+
'title' => 'Tags',
324324
'value' => sprintf('```%s```', json_encode($extra['tags'])),
325325
'short' => false
326326
),
327327
array(
328-
'title' => 'test',
328+
'title' => 'Test',
329329
'value' => $context['test'],
330330
'short' => false
331331
)
@@ -376,12 +376,12 @@ public function testExcludeExtraAndContextFields()
376376

377377
$expected = array(
378378
array(
379-
'title' => 'info',
379+
'title' => 'Info',
380380
'value' => sprintf('```%s```', json_encode(array('author' => 'Jordi'), $this->jsonPrettyPrintFlag)),
381381
'short' => false
382382
),
383383
array(
384-
'title' => 'tags',
384+
'title' => 'Tags',
385385
'value' => sprintf('```%s```', json_encode(array('web'))),
386386
'short' => false
387387
),

0 commit comments

Comments
 (0)