File: 0006-Adapt-to-recent-version-of-PHPUnit-9.patch

package info (click to toggle)
php-monolog 1.26.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 2,240 kB
  • sloc: php: 13,673; makefile: 12
file content (168 lines) | stat: -rw-r--r-- 9,163 bytes parent folder | download
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
From: =?utf-8?q?David_Pr=C3=A9vot?= <david@tilapin.org>
Date: Sat, 26 Dec 2020 10:29:06 -0400
Subject: Adapt to recent version of PHPUnit (9)

---
 tests/Monolog/Formatter/MongoDBFormatterTest.php         | 6 +++---
 tests/Monolog/Handler/NativeMailerHandlerTest.php        | 4 ++--
 tests/Monolog/Handler/RavenHandlerTest.php               | 2 +-
 tests/Monolog/Handler/Slack/SlackRecordTest.php          | 4 ++--
 tests/Monolog/Handler/SocketHandlerTest.php              | 2 +-
 tests/Monolog/Processor/IntrospectionProcessorTest.php   | 8 ++++----
 tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php | 2 +-
 tests/Monolog/Processor/MemoryUsageProcessorTest.php     | 2 +-
 tests/Monolog/Processor/ProcessIdProcessorTest.php       | 2 +-
 9 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/tests/Monolog/Formatter/MongoDBFormatterTest.php b/tests/Monolog/Formatter/MongoDBFormatterTest.php
index 32f4c76..930bdea 100644
--- a/tests/Monolog/Formatter/MongoDBFormatterTest.php
+++ b/tests/Monolog/Formatter/MongoDBFormatterTest.php
@@ -122,9 +122,9 @@ class MongoDBFormatterTest extends \PHPUnit\Framework\TestCase
         $this->assertCount(5, $formattedRecord['context']['except']);
         $this->assertEquals('exception message', $formattedRecord['context']['except']['message']);
         $this->assertEquals(987, $formattedRecord['context']['except']['code']);
-        $this->assertInternalType('string', $formattedRecord['context']['except']['file']);
-        $this->assertInternalType('integer', $formattedRecord['context']['except']['code']);
-        $this->assertInternalType('string', $formattedRecord['context']['except']['trace']);
+        $this->assertIsString($formattedRecord['context']['except']['file']);
+        $this->assertIsInt($formattedRecord['context']['except']['code']);
+        $this->assertIsString($formattedRecord['context']['except']['trace']);
         $this->assertEquals('Exception', $formattedRecord['context']['except']['class']);
     }
 
diff --git a/tests/Monolog/Handler/NativeMailerHandlerTest.php b/tests/Monolog/Handler/NativeMailerHandlerTest.php
index cb510b7..bfa40bb 100644
--- a/tests/Monolog/Handler/NativeMailerHandlerTest.php
+++ b/tests/Monolog/Handler/NativeMailerHandlerTest.php
@@ -76,7 +76,7 @@ class NativeMailerHandlerTest extends TestCase
         // non-empty batch
         $mailer->handle($this->getRecord(Logger::ERROR, "Foo\nBar\r\n\r\nBaz"));
         $this->assertNotEmpty($GLOBALS['mail']);
-        $this->assertInternalType('array', $GLOBALS['mail']);
+        $this->assertIsArray($GLOBALS['mail']);
         $this->assertArrayHasKey('0', $GLOBALS['mail']);
         $params = $GLOBALS['mail'][0];
         $this->assertCount(5, $params);
@@ -92,7 +92,7 @@ class NativeMailerHandlerTest extends TestCase
         $mailer = new NativeMailerHandler('to@example.org', 'Alert: %level_name% %message%', 'from@example.org');
         $mailer->handle($this->getRecord(Logger::ERROR, "Foo\nBar\r\n\r\nBaz"));
         $this->assertNotEmpty($GLOBALS['mail']);
-        $this->assertInternalType('array', $GLOBALS['mail']);
+        $this->assertIsArray($GLOBALS['mail']);
         $this->assertArrayHasKey('0', $GLOBALS['mail']);
         $params = $GLOBALS['mail'][0];
         $this->assertCount(5, $params);
diff --git a/tests/Monolog/Handler/RavenHandlerTest.php b/tests/Monolog/Handler/RavenHandlerTest.php
index ac00ea1..8130368 100644
--- a/tests/Monolog/Handler/RavenHandlerTest.php
+++ b/tests/Monolog/Handler/RavenHandlerTest.php
@@ -135,7 +135,7 @@ class RavenHandlerTest extends TestCase
 
         // check to see if its reset
         $handler->handle($recordWithNoContext);
-        $this->assertInternalType('array', $ravenClient->context->user);
+        $this->assertIsArray($ravenClient->context->user);
         $this->assertSame('test_user_id', $ravenClient->context->user['id']);
 
         // handle with null context
diff --git a/tests/Monolog/Handler/Slack/SlackRecordTest.php b/tests/Monolog/Handler/Slack/SlackRecordTest.php
index 8873242..8c10e03 100644
--- a/tests/Monolog/Handler/Slack/SlackRecordTest.php
+++ b/tests/Monolog/Handler/Slack/SlackRecordTest.php
@@ -157,7 +157,7 @@ class SlackRecordTest extends TestCase
 
         $this->assertArrayHasKey('attachments', $data);
         $this->assertArrayHasKey(0, $data['attachments']);
-        $this->assertInternalType('array', $data['attachments'][0]);
+        $this->assertIsArray($data['attachments'][0]);
     }
 
     public function testTextEqualsMessageIfNoAttachment()
@@ -358,7 +358,7 @@ class SlackRecordTest extends TestCase
         $record = $this->getRecord(Logger::CRITICAL, 'This is a critical message.', array('exception' => new \Exception()));
         $slackRecord = new SlackRecord(null, null, true, null, false, true);
         $data = $slackRecord->getSlackData($record);
-        $this->assertInternalType('string', $data['attachments'][0]['fields'][1]['value']);
+        $this->assertIsString($data['attachments'][0]['fields'][1]['value']);
     }
 
     public function testExcludeExtraAndContextFields()
diff --git a/tests/Monolog/Handler/SocketHandlerTest.php b/tests/Monolog/Handler/SocketHandlerTest.php
index 3d1d355..eb5667b 100644
--- a/tests/Monolog/Handler/SocketHandlerTest.php
+++ b/tests/Monolog/Handler/SocketHandlerTest.php
@@ -227,7 +227,7 @@ class SocketHandlerTest extends TestCase
     {
         $this->setMockHandler();
         $this->writeRecord('Hello world');
-        $this->assertInternalType('resource', $this->res);
+        $this->assertIsResource($this->res);
         $this->handler->close();
         $this->assertFalse(is_resource($this->res), "Expected resource to be closed after closing handler");
     }
diff --git a/tests/Monolog/Processor/IntrospectionProcessorTest.php b/tests/Monolog/Processor/IntrospectionProcessorTest.php
index 0dd411d..59a9c02 100644
--- a/tests/Monolog/Processor/IntrospectionProcessorTest.php
+++ b/tests/Monolog/Processor/IntrospectionProcessorTest.php
@@ -90,8 +90,8 @@ class IntrospectionProcessorTest extends TestCase
         $expected['extra'] = array(
             'file' => null,
             'line' => null,
-            'class' => 'ReflectionMethod',
-            'function' => 'invokeArgs',
+            'class' => 'PHPUnit\Framework\TestCase',
+            'function' => 'runTest',
         );
 
         $processor = new IntrospectionProcessor(Logger::CRITICAL);
@@ -111,8 +111,8 @@ class IntrospectionProcessorTest extends TestCase
         $expected['extra'] = array(
             'file' => null,
             'line' => null,
-            'class' => 'ReflectionMethod',
-            'function' => 'invokeArgs',
+            'class' => 'PHPUnit\Framework\TestCase',
+            'function' => 'runTest',
         );
 
         $processor = new IntrospectionProcessor(Logger::CRITICAL);
diff --git a/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php b/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php
index eb66614..8a2a3d7 100644
--- a/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php
+++ b/tests/Monolog/Processor/MemoryPeakUsageProcessorTest.php
@@ -36,7 +36,7 @@ class MemoryPeakUsageProcessorTest extends TestCase
         $processor = new MemoryPeakUsageProcessor(true, false);
         $record = $processor($this->getRecord());
         $this->assertArrayHasKey('memory_peak_usage', $record['extra']);
-        $this->assertInternalType('int', $record['extra']['memory_peak_usage']);
+        $this->assertIsInt($record['extra']['memory_peak_usage']);
         $this->assertGreaterThan(0, $record['extra']['memory_peak_usage']);
     }
 }
diff --git a/tests/Monolog/Processor/MemoryUsageProcessorTest.php b/tests/Monolog/Processor/MemoryUsageProcessorTest.php
index 4692dbf..41c54e8 100644
--- a/tests/Monolog/Processor/MemoryUsageProcessorTest.php
+++ b/tests/Monolog/Processor/MemoryUsageProcessorTest.php
@@ -36,7 +36,7 @@ class MemoryUsageProcessorTest extends TestCase
         $processor = new MemoryUsageProcessor(true, false);
         $record = $processor($this->getRecord());
         $this->assertArrayHasKey('memory_usage', $record['extra']);
-        $this->assertInternalType('int', $record['extra']['memory_usage']);
+        $this->assertIsInt($record['extra']['memory_usage']);
         $this->assertGreaterThan(0, $record['extra']['memory_usage']);
     }
 }
diff --git a/tests/Monolog/Processor/ProcessIdProcessorTest.php b/tests/Monolog/Processor/ProcessIdProcessorTest.php
index 458d2a3..9b7ad8a 100644
--- a/tests/Monolog/Processor/ProcessIdProcessorTest.php
+++ b/tests/Monolog/Processor/ProcessIdProcessorTest.php
@@ -23,7 +23,7 @@ class ProcessIdProcessorTest extends TestCase
         $processor = new ProcessIdProcessor();
         $record = $processor($this->getRecord());
         $this->assertArrayHasKey('process_id', $record['extra']);
-        $this->assertInternalType('int', $record['extra']['process_id']);
+        $this->assertIsInt($record['extra']['process_id']);
         $this->assertGreaterThan(0, $record['extra']['process_id']);
         $this->assertEquals(getmypid(), $record['extra']['process_id']);
     }