File: 0003-Adapt-to-recent-version-of-PHPUnit-10.patch

package info (click to toggle)
php-masterminds-html5 2.10.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 824 kB
  • sloc: php: 9,678; makefile: 21
file content (307 lines) | stat: -rw-r--r-- 14,979 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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
From: =?utf-8?q?David_Pr=C3=A9vot?= <david@tilapin.org>
Date: Wed, 2 Aug 2023 07:48:46 +0200
Subject: Adapt to recent version of PHPUnit (10)

Use assertMatchesRegularExpression instead of assertRegExp.

Bug-Debian: https://bugs.debian.org/1039794
---
 test/HTML5/Html5Test.php                  | 80 +++++++++++++++----------------
 test/HTML5/Serializer/OutputRulesTest.php | 26 +++++-----
 2 files changed, 53 insertions(+), 53 deletions(-)

diff --git a/test/HTML5/Html5Test.php b/test/HTML5/Html5Test.php
index 7c2f485..0349209 100644
--- a/test/HTML5/Html5Test.php
+++ b/test/HTML5/Html5Test.php
@@ -236,7 +236,7 @@ class Html5Test extends TestCase
         $this->assertEmpty($this->html5->getErrors());
 
         $saved = $this->html5->saveHTML($dom);
-        $this->assertRegExp('|<p>This is a test.</p>|', $saved);
+        $this->assertMatchesRegularExpression('|<p>This is a test.</p>|', $saved);
     }
 
     public function testSaveHTMLFragment()
@@ -258,13 +258,13 @@ class Html5Test extends TestCase
         $file = fopen('php://temp', 'w');
         $this->html5->save($dom, $file);
         $content = stream_get_contents($file, -1, 0);
-        $this->assertRegExp('|<p>This is a test.</p>|', $content);
+        $this->assertMatchesRegularExpression('|<p>This is a test.</p>|', $content);
 
         // Test file
         $tmpfname = tempnam(sys_get_temp_dir(), 'html5-php');
         $this->html5->save($dom, $tmpfname);
         $content = file_get_contents($tmpfname);
-        $this->assertRegExp('|<p>This is a test.</p>|', $content);
+        $this->assertMatchesRegularExpression('|<p>This is a test.</p>|', $content);
         unlink($tmpfname);
     }
 
@@ -340,8 +340,8 @@ class Html5Test extends TestCase
         $this->assertNotEquals('textpath', $textPath->tagName);
 
         $html = $this->html5->saveHTML($dom);
-        $this->assertRegExp('|<svg width="150" height="100" viewBox="0 0 3 2">|', $html);
-        $this->assertRegExp('|<rect width="1" height="2" x="0" fill="#008d46" />|', $html);
+        $this->assertMatchesRegularExpression('|<svg width="150" height="100" viewBox="0 0 3 2">|', $html);
+        $this->assertMatchesRegularExpression('|<rect width="1" height="2" x="0" fill="#008d46" />|', $html);
     }
 
     public function testMathMl()
@@ -376,8 +376,8 @@ class Html5Test extends TestCase
         $this->assertFalse($csymbol->hasAttribute('definitionurl'));
 
         $html = $this->html5->saveHTML($dom);
-        $this->assertRegExp('|<csymbol definitionURL="http://www.example.com/mathops/multiops.html#plusminus">|', $html);
-        $this->assertRegExp('|<mi>y</mi>|', $html);
+        $this->assertMatchesRegularExpression('|<csymbol definitionURL="http://www.example.com/mathops/multiops.html#plusminus">|', $html);
+        $this->assertMatchesRegularExpression('|<mi>y</mi>|', $html);
     }
 
     public function testUnknownElements()
@@ -396,37 +396,37 @@ class Html5Test extends TestCase
 
         $this->assertEmpty($this->html5->getErrors());
         $markup = $this->html5->saveHTML($dom);
-        $this->assertRegExp('|<f:name>Big rectangle thing</f:name>|', $markup);
-        $this->assertRegExp('|<sarcasm>um, yeah</sarcasm>|', $markup);
+        $this->assertMatchesRegularExpression('|<f:name>Big rectangle thing</f:name>|', $markup);
+        $this->assertMatchesRegularExpression('|<sarcasm>um, yeah</sarcasm>|', $markup);
     }
 
     public function testElements()
     {
         // Should have content.
         $res = $this->cycle('<div>FOO</div>');
-        $this->assertRegExp('|<div>FOO</div>|', $res);
+        $this->assertMatchesRegularExpression('|<div>FOO</div>|', $res);
 
         // Should be empty
         $res = $this->cycle('<span></span>');
-        $this->assertRegExp('|<span></span>|', $res);
+        $this->assertMatchesRegularExpression('|<span></span>|', $res);
 
         // Should have content.
         $res = $this->cycleFragment('<div>FOO</div>');
-        $this->assertRegExp('|<div>FOO</div>|', $res);
+        $this->assertMatchesRegularExpression('|<div>FOO</div>|', $res);
 
         // Should be empty
         $res = $this->cycleFragment('<span></span>');
-        $this->assertRegExp('|<span></span>|', $res);
+        $this->assertMatchesRegularExpression('|<span></span>|', $res);
 
         // Elements with dashes and underscores
         $res = $this->cycleFragment('<sp-an></sp-an>');
-        $this->assertRegExp('|<sp-an></sp-an>|', $res);
+        $this->assertMatchesRegularExpression('|<sp-an></sp-an>|', $res);
         $res = $this->cycleFragment('<sp_an></sp_an>');
-        $this->assertRegExp('|<sp_an></sp_an>|', $res);
+        $this->assertMatchesRegularExpression('|<sp_an></sp_an>|', $res);
 
         // Should have no closing tag.
         $res = $this->cycle('<hr>');
-        $this->assertRegExp('|<hr></body>|', $res);
+        $this->assertMatchesRegularExpression('|<hr></body>|', $res);
     }
 
     public function testAttributes()
@@ -441,33 +441,33 @@ class Html5Test extends TestCase
         }
 
         $res = $this->cycle('<div attr="val">FOO</div>');
-        $this->assertRegExp('|<div attr="val">FOO</div>|', $res);
+        $this->assertMatchesRegularExpression('|<div attr="val">FOO</div>|', $res);
 
         // XXX: Note that spec does NOT require attrs in the same order.
         $res = $this->cycle('<div attr="val" class="even">FOO</div>');
-        $this->assertRegExp('|<div attr="val" class="even">FOO</div>|', $res);
+        $this->assertMatchesRegularExpression('|<div attr="val" class="even">FOO</div>|', $res);
 
         $res = $this->cycle('<div xmlns:foo="http://example.com">FOO</div>');
-        $this->assertRegExp('|<div xmlns:foo="http://example.com">FOO</div>|', $res);
+        $this->assertMatchesRegularExpression('|<div xmlns:foo="http://example.com">FOO</div>|', $res);
 
         $res = $this->cycleFragment('<div attr="val">FOO</div>');
-        $this->assertRegExp('|<div attr="val">FOO</div>|', $res);
+        $this->assertMatchesRegularExpression('|<div attr="val">FOO</div>|', $res);
 
         // XXX: Note that spec does NOT require attrs in the same order.
         $res = $this->cycleFragment('<div attr="val" class="even">FOO</div>');
-        $this->assertRegExp('|<div attr="val" class="even">FOO</div>|', $res);
+        $this->assertMatchesRegularExpression('|<div attr="val" class="even">FOO</div>|', $res);
 
         $res = $this->cycleFragment('<div xmlns:foo="http://example.com">FOO</div>');
-        $this->assertRegExp('|<div xmlns:foo="http://example.com">FOO</div>|', $res);
+        $this->assertMatchesRegularExpression('|<div xmlns:foo="http://example.com">FOO</div>|', $res);
     }
 
     public function testPCData()
     {
         $res = $this->cycle('<a>This is a test.</a>');
-        $this->assertRegExp('|This is a test.|', $res);
+        $this->assertMatchesRegularExpression('|This is a test.|', $res);
 
         $res = $this->cycleFragment('<a>This is a test.</a>');
-        $this->assertRegExp('|This is a test.|', $res);
+        $this->assertMatchesRegularExpression('|This is a test.|', $res);
 
         $res = $this->cycle('This
       is
@@ -475,7 +475,7 @@ class Html5Test extends TestCase
       test.');
 
         // Check that newlines are there, but don't count spaces.
-        $this->assertRegExp('|This\n\s*is\n\s*a\n\s*test.|', $res);
+        $this->assertMatchesRegularExpression('|This\n\s*is\n\s*a\n\s*test.|', $res);
 
         $res = $this->cycleFragment('This
       is
@@ -483,40 +483,40 @@ class Html5Test extends TestCase
       test.');
 
         // Check that newlines are there, but don't count spaces.
-        $this->assertRegExp('|This\n\s*is\n\s*a\n\s*test.|', $res);
+        $this->assertMatchesRegularExpression('|This\n\s*is\n\s*a\n\s*test.|', $res);
 
         $res = $this->cycle('<a>This <em>is</em> a test.</a>');
-        $this->assertRegExp('|This <em>is</em> a test.|', $res);
+        $this->assertMatchesRegularExpression('|This <em>is</em> a test.|', $res);
 
         $res = $this->cycleFragment('<a>This <em>is</em> a test.</a>');
-        $this->assertRegExp('|This <em>is</em> a test.|', $res);
+        $this->assertMatchesRegularExpression('|This <em>is</em> a test.|', $res);
     }
 
     public function testUnescaped()
     {
         $res = $this->cycle('<script>2 < 1</script>');
-        $this->assertRegExp('|2 < 1|', $res);
+        $this->assertMatchesRegularExpression('|2 < 1|', $res);
 
         $res = $this->cycle('<style>div>div>div</style>');
-        $this->assertRegExp('|div>div>div|', $res);
+        $this->assertMatchesRegularExpression('|div>div>div|', $res);
 
         $res = $this->cycleFragment('<script>2 < 1</script>');
-        $this->assertRegExp('|2 < 1|', $res);
+        $this->assertMatchesRegularExpression('|2 < 1|', $res);
 
         $res = $this->cycleFragment('<style>div>div>div</style>');
-        $this->assertRegExp('|div>div>div|', $res);
+        $this->assertMatchesRegularExpression('|div>div>div|', $res);
     }
 
     public function testEntities()
     {
         $res = $this->cycle('<a>Apples &amp; bananas.</a>');
-        $this->assertRegExp('|Apples &amp; bananas.|', $res);
+        $this->assertMatchesRegularExpression('|Apples &amp; bananas.|', $res);
 
         $res = $this->cycleFragment('<a>Apples &amp; bananas.</a>');
-        $this->assertRegExp('|Apples &amp; bananas.|', $res);
+        $this->assertMatchesRegularExpression('|Apples &amp; bananas.|', $res);
 
         $res = $this->cycleFragment('<p>R&D</p>');
-        $this->assertRegExp('|R&amp;D|', $res);
+        $this->assertMatchesRegularExpression('|R&amp;D|', $res);
     }
 
     public function testCaseSensitiveTags()
@@ -528,25 +528,25 @@ class Html5Test extends TestCase
             )
         );
         $out = $this->html5->saveHTML($dom);
-        $this->assertRegExp('|<html><body><Button color="red">Error</Button></body></html>|', $out);
+        $this->assertMatchesRegularExpression('|<html><body><Button color="red">Error</Button></body></html>|', $out);
     }
 
     public function testComment()
     {
         $res = $this->cycle('a<!-- This is a test. -->b');
-        $this->assertRegExp('|<!-- This is a test. -->|', $res);
+        $this->assertMatchesRegularExpression('|<!-- This is a test. -->|', $res);
 
         $res = $this->cycleFragment('a<!-- This is a test. -->b');
-        $this->assertRegExp('|<!-- This is a test. -->|', $res);
+        $this->assertMatchesRegularExpression('|<!-- This is a test. -->|', $res);
     }
 
     public function testCDATA()
     {
         $res = $this->cycle('a<![CDATA[ This <is> a test. ]]>b');
-        $this->assertRegExp('|<!\[CDATA\[ This <is> a test\. \]\]>|', $res);
+        $this->assertMatchesRegularExpression('|<!\[CDATA\[ This <is> a test\. \]\]>|', $res);
 
         $res = $this->cycleFragment('a<![CDATA[ This <is> a test. ]]>b');
-        $this->assertRegExp('|<!\[CDATA\[ This <is> a test\. \]\]>|', $res);
+        $this->assertMatchesRegularExpression('|<!\[CDATA\[ This <is> a test\. \]\]>|', $res);
     }
 
     public function testAnchorTargetQueryParam()
diff --git a/test/HTML5/Serializer/OutputRulesTest.php b/test/HTML5/Serializer/OutputRulesTest.php
index 7155e25..991092c 100644
--- a/test/HTML5/Serializer/OutputRulesTest.php
+++ b/test/HTML5/Serializer/OutputRulesTest.php
@@ -550,9 +550,9 @@ class OutputRulesTest extends \Masterminds\HTML5\Tests\TestCase
         $list = $dom->getElementsByTagName('svg');
         $r->element($list->item(0));
         $contents = stream_get_contents($stream, -1, 0);
-        $this->assertRegExp('|<svg width="150" height="100" viewBox="0 0 3 2">|', $contents);
-        $this->assertRegExp('|<rect width="1" height="2" x="0" fill="#008d46" />|', $contents);
-        $this->assertRegExp('|<rect id="Bar" x="300" y="100" width="300" height="100" fill="rgb\(255,255,0\)">|', $contents);
+        $this->assertMatchesRegularExpression('|<svg width="150" height="100" viewBox="0 0 3 2">|', $contents);
+        $this->assertMatchesRegularExpression('|<rect width="1" height="2" x="0" fill="#008d46" />|', $contents);
+        $this->assertMatchesRegularExpression('|<rect id="Bar" x="300" y="100" width="300" height="100" fill="rgb\(255,255,0\)">|', $contents);
     }
 
     public function testMath()
@@ -579,8 +579,8 @@ class OutputRulesTest extends \Masterminds\HTML5\Tests\TestCase
         $list = $dom->getElementsByTagName('math');
         $r->element($list->item(0));
         $content = stream_get_contents($stream, -1, 0);
-        $this->assertRegExp('|<math>|', $content);
-        $this->assertRegExp('|<csymbol definitionURL="http://www.example.com/mathops/multiops.html#plusminus">|', $content);
+        $this->assertMatchesRegularExpression('|<math>|', $content);
+        $this->assertMatchesRegularExpression('|<csymbol definitionURL="http://www.example.com/mathops/multiops.html#plusminus">|', $content);
     }
 
     public function testProcessorInstruction()
@@ -593,7 +593,7 @@ class OutputRulesTest extends \Masterminds\HTML5\Tests\TestCase
 
         $r->processorInstruction($dom->firstChild);
         $content = stream_get_contents($stream, -1, 0);
-        $this->assertRegExp('|<\?foo bar \?>|', $content);
+        $this->assertMatchesRegularExpression('|<\?foo bar \?>|', $content);
     }
 
     public function testAddressTag()
@@ -618,11 +618,11 @@ class OutputRulesTest extends \Masterminds\HTML5\Tests\TestCase
         $r->element($list->item(0));
         $contents = stream_get_contents($stream, -1, 0);
 
-        $this->assertRegExp('|<address>|', $contents);
-        $this->assertRegExp('|<a href="../People/Raggett/">Dave Raggett</a>,|', $contents);
-        $this->assertRegExp('|<a href="../People/Arnaud/">Arnaud Le Hors</a>,|', $contents);
-        $this->assertRegExp('|contact persons for the <a href="Activity">W3C HTML Activity</a>|', $contents);
-        $this->assertRegExp('|</address>|', $contents);
+        $this->assertMatchesRegularExpression('|<address>|', $contents);
+        $this->assertMatchesRegularExpression('|<a href="../People/Raggett/">Dave Raggett</a>,|', $contents);
+        $this->assertMatchesRegularExpression('|<a href="../People/Arnaud/">Arnaud Le Hors</a>,|', $contents);
+        $this->assertMatchesRegularExpression('|contact persons for the <a href="Activity">W3C HTML Activity</a>|', $contents);
+        $this->assertMatchesRegularExpression('|</address>|', $contents);
     }
 
     /**
@@ -666,7 +666,7 @@ class OutputRulesTest extends \Masterminds\HTML5\Tests\TestCase
 
         $contents = $this->html5->saveHTML($dom);
 
-        self::assertRegExp('|^\h*<svg />$|m', $contents);
-        self::assertRegExp('|^\h*<math />$|m', $contents);
+        self::assertMatchesRegularExpression('|^\h*<svg />$|m', $contents);
+        self::assertMatchesRegularExpression('|^\h*<math />$|m', $contents);
     }
 }