@@ -93,7 +93,12 @@ public function testEncodingUtf8()
93
93
$ this ->assertEmpty ($ this ->html5 ->getErrors ());
94
94
$ this ->assertFalse ($ this ->html5 ->hasErrors ());
95
95
96
- $ this ->assertContains ('Žťčýů ' , $ dom ->saveHTML ());
96
+ // phpunit 9
97
+ if (method_exists ($ this , 'assertStringContainsString ' )) {
98
+ $ this ->assertStringContainsString ('Žťčýů ' , $ dom ->saveHTML ());
99
+ } else {
100
+ $ this ->assertContains ('Žťčýů ' , $ dom ->saveHTML ());
101
+ }
97
102
}
98
103
99
104
public function testEncodingWindows1252 ()
@@ -373,7 +378,13 @@ public function testElements()
373
378
public function testAttributes ()
374
379
{
375
380
$ res = $ this ->cycle ('<use xlink:href="#svg-track" xmlns:xlink="http://www.w3.org/1999/xlink"></use> ' );
376
- $ this ->assertContains ('<use xlink:href="#svg-track" xmlns:xlink="http://www.w3.org/1999/xlink"></use> ' , $ res );
381
+
382
+ // phpunit 9
383
+ if (method_exists ($ this , 'assertStringContainsString ' )) {
384
+ $ this ->assertStringContainsString ('<use xlink:href="#svg-track" xmlns:xlink="http://www.w3.org/1999/xlink"></use> ' , $ res );
385
+ } else {
386
+ $ this ->assertContains ('<use xlink:href="#svg-track" xmlns:xlink="http://www.w3.org/1999/xlink"></use> ' , $ res );
387
+ }
377
388
378
389
$ res = $ this ->cycle ('<div attr="val">FOO</div> ' );
379
390
$ this ->assertRegExp ('|<div attr="val">FOO</div>| ' , $ res );
@@ -487,9 +498,12 @@ public function testCDATA()
487
498
public function testAnchorTargetQueryParam ()
488
499
{
489
500
$ res = $ this ->cycle ('<a href="https://domain.com/page.php?foo=bar&target=baz">https://domain.com/page.php?foo=bar&target=baz</a> ' );
490
- $ this ->assertContains (
491
- '<a href="https://domain.com/page.php?foo=bar&target=baz">https://domain.com/page.php?foo=bar&target=baz</a> ' ,
492
- $ res
493
- );
501
+
502
+ // phpunit 9
503
+ if (method_exists ($ this , 'assertStringContainsString ' )) {
504
+ $ this ->assertStringContainsString ('<a href="https://domain.com/page.php?foo=bar&target=baz">https://domain.com/page.php?foo=bar&target=baz</a> ' , $ res );
505
+ } else {
506
+ $ this ->assertContains ('<a href="https://domain.com/page.php?foo=bar&target=baz">https://domain.com/page.php?foo=bar&target=baz</a> ' , $ res );
507
+ }
494
508
}
495
509
}
0 commit comments