@@ -93,7 +93,12 @@ public function testEncodingUtf8()
9393 $ this ->assertEmpty ($ this ->html5 ->getErrors ());
9494 $ this ->assertFalse ($ this ->html5 ->hasErrors ());
9595
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+ }
97102 }
98103
99104 public function testEncodingWindows1252 ()
@@ -373,7 +378,13 @@ public function testElements()
373378 public function testAttributes ()
374379 {
375380 $ 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+ }
377388
378389 $ res = $ this ->cycle ('<div attr="val">FOO</div> ' );
379390 $ this ->assertRegExp ('|<div attr="val">FOO</div>| ' , $ res );
@@ -487,9 +498,12 @@ public function testCDATA()
487498 public function testAnchorTargetQueryParam ()
488499 {
489500 $ 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+ }
494508 }
495509}
0 commit comments