Procházet zdrojové kódy

Fix SlackRecord normalization of fields, closes #1078

Jordi Boggiano před 7 roky
rodič
revize
00aca28c8b

+ 2 - 2
src/Monolog/Handler/Slack/SlackRecord.php

@@ -146,7 +146,7 @@ class SlackRecord
 
                     if ($this->useShortAttachment) {
                         $attachment['fields'][] = $this->generateAttachmentField(
-                            ucfirst($key),
+                            $key,
                             $record[$key]
                         );
                     } else {
@@ -241,7 +241,7 @@ class SlackRecord
             : $value;
 
         return array(
-            'title' => $title,
+            'title' => ucfirst($title),
             'value' => $value,
             'short' => false
         );

+ 4 - 4
tests/Monolog/Handler/Slack/SlackRecordTest.php

@@ -320,12 +320,12 @@ class SlackRecordTest extends TestCase
                 'short' => false,
             ),
             array(
-                'title' => 'tags',
+                'title' => 'Tags',
                 'value' => sprintf('```%s```', json_encode($extra['tags'])),
                 'short' => false
             ),
             array(
-                'title' => 'test',
+                'title' => 'Test',
                 'value' => $context['test'],
                 'short' => false
             )
@@ -376,12 +376,12 @@ class SlackRecordTest extends TestCase
 
         $expected = array(
             array(
-                'title' => 'info',
+                'title' => 'Info',
                 'value' => sprintf('```%s```', json_encode(array('author' => 'Jordi'), $this->jsonPrettyPrintFlag)),
                 'short' => false
             ),
             array(
-                'title' => 'tags',
+                'title' => 'Tags',
                 'value' => sprintf('```%s```', json_encode(array('web'))),
                 'short' => false
             ),