Skip to content

Commit 3c66bb9

Browse files
committed
Amend tests to be forward compatible
1 parent cb08b06 commit 3c66bb9

File tree

3 files changed

+6
-99
lines changed

3 files changed

+6
-99
lines changed

ext/xml/tests/bug32001.phpt

Lines changed: 1 addition & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ HERE;
100100

101101
$parser = xml_parser_create(NULL);
102102
xml_parser_set_option($parser, XML_OPTION_CASE_FOLDING, 0);
103-
xml_set_object($parser, $this);
104-
xml_set_element_handler($parser, "start_element", "end_element");
103+
xml_set_element_handler($parser, $this->start_element(...), $this->end_element(...));
105104

106105
if ($this->chunk_size == 0) {
107106
$success = @xml_parse($parser, $data, true);
@@ -166,10 +165,6 @@ foreach ($suite as $testcase) {
166165
?>
167166
--EXPECTF--
168167
libxml2 Version => %s
169-
170-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
171-
172-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
173168
Encoding: UTF-8
174169
XML Prologue: present
175170
Chunk size: all data at once
@@ -182,10 +177,6 @@ array(3) {
182177
[2]=>
183178
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
184179
}
185-
186-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
187-
188-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
189180
Encoding: UTF-8
190181
XML Prologue: not present
191182
Chunk size: all data at once
@@ -198,10 +189,6 @@ array(3) {
198189
[2]=>
199190
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
200191
}
201-
202-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
203-
204-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
205192
Encoding: UTF-8
206193
XML Prologue: present
207194
Chunk size: all data at once
@@ -214,10 +201,6 @@ array(3) {
214201
[2]=>
215202
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
216203
}
217-
218-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
219-
220-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
221204
Encoding: UTF-8
222205
XML Prologue: not present
223206
Chunk size: all data at once
@@ -230,10 +213,6 @@ array(3) {
230213
[2]=>
231214
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
232215
}
233-
234-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
235-
236-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
237216
Encoding: UTF-16BE
238217
XML Prologue: present
239218
Chunk size: all data at once
@@ -246,10 +225,6 @@ array(3) {
246225
[2]=>
247226
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
248227
}
249-
250-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
251-
252-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
253228
Encoding: UTF-16BE
254229
XML Prologue: present
255230
Chunk size: all data at once
@@ -262,10 +237,6 @@ array(3) {
262237
[2]=>
263238
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
264239
}
265-
266-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
267-
268-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
269240
Encoding: UTF-16BE
270241
XML Prologue: not present
271242
Chunk size: all data at once
@@ -278,10 +249,6 @@ array(3) {
278249
[2]=>
279250
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
280251
}
281-
282-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
283-
284-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
285252
Encoding: UTF-16LE
286253
XML Prologue: present
287254
Chunk size: all data at once
@@ -294,10 +261,6 @@ array(3) {
294261
[2]=>
295262
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
296263
}
297-
298-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
299-
300-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
301264
Encoding: UTF-16LE
302265
XML Prologue: present
303266
Chunk size: all data at once
@@ -310,10 +273,6 @@ array(3) {
310273
[2]=>
311274
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
312275
}
313-
314-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
315-
316-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
317276
Encoding: UTF-16LE
318277
XML Prologue: not present
319278
Chunk size: all data at once
@@ -326,10 +285,6 @@ array(3) {
326285
[2]=>
327286
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
328287
}
329-
330-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
331-
332-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
333288
Encoding: UTF-8
334289
XML Prologue: present
335290
Chunk size: 1 byte(s)
@@ -342,10 +297,6 @@ array(3) {
342297
[2]=>
343298
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
344299
}
345-
346-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
347-
348-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
349300
Encoding: UTF-8
350301
XML Prologue: not present
351302
Chunk size: 1 byte(s)
@@ -358,10 +309,6 @@ array(3) {
358309
[2]=>
359310
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
360311
}
361-
362-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
363-
364-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
365312
Encoding: UTF-8
366313
XML Prologue: present
367314
Chunk size: 1 byte(s)
@@ -374,10 +321,6 @@ array(3) {
374321
[2]=>
375322
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
376323
}
377-
378-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
379-
380-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
381324
Encoding: UTF-8
382325
XML Prologue: not present
383326
Chunk size: 1 byte(s)
@@ -390,10 +333,6 @@ array(3) {
390333
[2]=>
391334
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
392335
}
393-
394-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
395-
396-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
397336
Encoding: UTF-16BE
398337
XML Prologue: present
399338
Chunk size: 1 byte(s)
@@ -406,10 +345,6 @@ array(3) {
406345
[2]=>
407346
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
408347
}
409-
410-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
411-
412-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
413348
Encoding: UTF-16BE
414349
XML Prologue: present
415350
Chunk size: 1 byte(s)
@@ -422,10 +357,6 @@ array(3) {
422357
[2]=>
423358
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
424359
}
425-
426-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
427-
428-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
429360
Encoding: UTF-16BE
430361
XML Prologue: not present
431362
Chunk size: 1 byte(s)
@@ -438,10 +369,6 @@ array(3) {
438369
[2]=>
439370
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
440371
}
441-
442-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
443-
444-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
445372
Encoding: UTF-16LE
446373
XML Prologue: present
447374
Chunk size: 1 byte(s)
@@ -454,10 +381,6 @@ array(3) {
454381
[2]=>
455382
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
456383
}
457-
458-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
459-
460-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
461384
Encoding: UTF-16LE
462385
XML Prologue: present
463386
Chunk size: 1 byte(s)
@@ -470,10 +393,6 @@ array(3) {
470393
[2]=>
471394
string(42) "e38386e382b9e383883ae38386e382b9e3838833: "
472395
}
473-
474-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
475-
476-
Deprecated: xml_set_element_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
477396
Encoding: UTF-16LE
478397
XML Prologue: not present
479398
Chunk size: 1 byte(s)

ext/xml/tests/xml_set_notation_decl_handler_basic.phpt

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ class XML_Parser
2929
function parse($data)
3030
{
3131
$parser = xml_parser_create();
32-
xml_set_object($parser, $this);
33-
xml_set_notation_decl_handler($parser, "notation_decl_handler");
34-
xml_set_unparsed_entity_decl_handler($parser, "unparsed_entity_decl_handler");
32+
xml_set_notation_decl_handler($parser, $this->notation_decl_handler(...));
33+
xml_set_unparsed_entity_decl_handler($parser, $this->unparsed_entity_decl_handler(...));
3534
xml_parse($parser, $data, true);
3635
xml_parser_free($parser);
3736
}
@@ -54,14 +53,8 @@ $p1 = new Xml_Parser();
5453
$p1->parse($xml);
5554
echo "Done\n";
5655
?>
57-
--EXPECTF--
56+
--EXPECT--
5857
Simple test of xml_set_notation_decl_handler(() function
59-
60-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
61-
62-
Deprecated: xml_set_notation_decl_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
63-
64-
Deprecated: xml_set_unparsed_entity_decl_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
6558
notation_decl_handler called
6659
...Name=USDATE
6760
...Base=

ext/xml/tests/xml_set_processing_instruction_handler_basic.phpt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,7 @@ class XML_Parser
1616
function parse($data)
1717
{
1818
$parser = xml_parser_create();
19-
xml_set_object($parser, $this);
20-
xml_set_processing_instruction_handler($parser, "PIHandler");
19+
xml_set_processing_instruction_handler($parser, $this->PIHandler(...));
2120
xml_parse($parser, $data, true);
2221
xml_parser_free($parser);
2322
}
@@ -35,12 +34,8 @@ $p1 = new Xml_Parser();
3534
$p1->parse($xml);
3635
echo "Done\n";
3736
?>
38-
--EXPECTF--
37+
--EXPECT--
3938
Simple test of xml_set_processing_instruction_handler() function
40-
41-
Deprecated: Function xml_set_object() is deprecated since 8.4, provide a proper method callable to xml_set_*_handler() functions in %s on line %d
42-
43-
Deprecated: xml_set_processing_instruction_handler(): Passing non-callable strings is deprecated since 8.4 in %s on line %d
4439
Target: xml-stylesheet
4540
Data: href="default.xsl" type="text/xml"
4641
Done

0 commit comments

Comments
 (0)