blob: d687ff28141fda07aaecd64218170e57ea451a76 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
diff --git a/tests/Monolog/Handler/MockRavenClient-gte-0-16-0.php b/tests/Monolog/Handler/MockRavenClient-gte-0-16-0.php
new file mode 100644
index 0000000..07434e4
--- /dev/null
+++ b/tests/Monolog/Handler/MockRavenClient-gte-0-16-0.php
@@ -0,0 +1,27 @@
+<?php declare(strict_types=1);
+
+/*
+ * 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 Raven_Client;
+
+class MockRavenClient extends Raven_Client
+{
+ public function capture($data, $stack = null, $vars = null)
+ {
+ $data = array_merge($this->get_user_data(), $data);
+ $this->lastData = $data;
+ $this->lastStack = $stack;
+ }
+
+ public $lastData;
+ public $lastStack;
+}
diff --git a/tests/Monolog/Handler/RavenHandlerTest.php b/tests/Monolog/Handler/RavenHandlerTest.php
index a7c4845..6ed5790 100644
--- a/tests/Monolog/Handler/RavenHandlerTest.php
+++ b/tests/Monolog/Handler/RavenHandlerTest.php
@@ -14,16 +14,21 @@ namespace Monolog\Handler;
use Monolog\TestCase;
use Monolog\Logger;
use Monolog\Formatter\LineFormatter;
+use Raven_Client;
class RavenHandlerTest extends TestCase
{
public function setUp()
{
if (!class_exists('Raven_Client')) {
- $this->markTestSkipped('raven/raven not installed');
+ $this->markTestSkipped('sentry/sentry not installed');
}
- require_once __DIR__ . '/MockRavenClient.php';
+ if (version_compare(Raven_Client::VERSION, '0.16.0', '>=')) {
+ require_once __DIR__ . '/MockRavenClient-gte-0-16-0.php';
+ } else {
+ require_once __DIR__ . '/MockRavenClient.php';
+ }
}
/**
|