瀏覽代碼

Restore ability to continue using mlehner/gelf-php in test

Was previously broken by a coding standard commit 392ef35fd470638e08d0160d6b1cbab63cb23174
John Kary 11 年之前
父節點
當前提交
6c1836467c
共有 2 個文件被更改,包括 27 次插入0 次删除
  1. 2 0
      tests/Monolog/Handler/GelfHandlerLegacyTest.php
  2. 25 0
      tests/Monolog/Handler/GelfMocks.php

+ 2 - 0
tests/Monolog/Handler/GelfHandlerLegacyTest.php

@@ -23,6 +23,8 @@ class GelfHandlerLegacyTest extends TestCase
         if (!class_exists('Gelf\MessagePublisher') || !class_exists('Gelf\Message')) {
             $this->markTestSkipped("mlehner/gelf-php not installed");
         }
+
+        require_once __DIR__ . '/GelfMocks.php';
     }
 
     /**

+ 25 - 0
tests/Monolog/Handler/GelfMocks.php

@@ -0,0 +1,25 @@
+<?php
+
+/*
+ * This file is part of the Monolog package.
+ *
+ * (c) Jordi Boggiano <j.boggiano@seld.be>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
+
+namespace Monolog\Handler;
+
+use Gelf\MessagePublisher;
+use Gelf\Message;
+
+class MockMessagePublisher extends MessagePublisher
+{
+    public function publish(Message $message)
+    {
+        $this->lastMessage = $message;
+    }
+
+    public $lastMessage = null;
+}