@@ -147,7 +147,12 @@ public function testEncodingUtf8()
147147 $ this ->assertEmpty ($ this ->html5 ->getErrors ());
148148 $ this ->assertFalse ($ this ->html5 ->hasErrors ());
149149
150- $ this ->assertContains ('Žťčýů ' , $ dom ->saveHTML ());
150+ // phpunit 9
151+ if (method_exists ($ this , 'assertStringContainsString ' )) {
152+ $ this ->assertStringContainsString ('Žťčýů ' , $ dom ->saveHTML ());
153+ } else {
154+ $ this ->assertContains ('Žťčýů ' , $ dom ->saveHTML ());
155+ }
151156 }
152157
153158 public function testEncodingWindows1252 ()
@@ -427,7 +432,13 @@ public function testElements()
427432 public function testAttributes ()
428433 {
429434 $ res = $ this ->cycle ('<use xlink:href="#svg-track" xmlns:xlink="http://www.w3.org/1999/xlink"></use> ' );
430- $ this ->assertContains ('<use xlink:href="#svg-track" xmlns:xlink="http://www.w3.org/1999/xlink"></use> ' , $ res );
435+
436+ // phpunit 9
437+ if (method_exists ($ this , 'assertStringContainsString ' )) {
438+ $ this ->assertStringContainsString ('<use xlink:href="#svg-track" xmlns:xlink="http://www.w3.org/1999/xlink"></use> ' , $ res );
439+ } else {
440+ $ this ->assertContains ('<use xlink:href="#svg-track" xmlns:xlink="http://www.w3.org/1999/xlink"></use> ' , $ res );
441+ }
431442
432443 $ res = $ this ->cycle ('<div attr="val">FOO</div> ' );
433444 $ this ->assertRegExp ('|<div attr="val">FOO</div>| ' , $ res );
@@ -541,9 +552,12 @@ public function testCDATA()
541552 public function testAnchorTargetQueryParam ()
542553 {
543554 $ res = $ this ->cycle ('<a href="https://domain.com/page.php?foo=bar&target=baz">https://domain.com/page.php?foo=bar&target=baz</a> ' );
544- $ this ->assertContains (
545- '<a href="https://domain.com/page.php?foo=bar&target=baz">https://domain.com/page.php?foo=bar&target=baz</a> ' ,
546- $ res
547- );
555+
556+ // phpunit 9
557+ if (method_exists ($ this , 'assertStringContainsString ' )) {
558+ $ this ->assertStringContainsString ('<a href="https://domain.com/page.php?foo=bar&target=baz">https://domain.com/page.php?foo=bar&target=baz</a> ' , $ res );
559+ } else {
560+ $ this ->assertContains ('<a href="https://domain.com/page.php?foo=bar&target=baz">https://domain.com/page.php?foo=bar&target=baz</a> ' , $ res );
561+ }
548562 }
549563}
0 commit comments