diff --git a/composer.json b/composer.json index 69f5da0..35b4a57 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "php" : ">=5.3.0" }, "require-dev": { - "phpunit/phpunit" : "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8" + "phpunit/phpunit" : "^4.8.35 || ^5.7.21 || ^6 || ^7 || ^8 || ^9" }, "autoload": { "psr-4": {"Masterminds\\": "src"} diff --git a/test/HTML5/Html5Test.php b/test/HTML5/Html5Test.php index 62f36e1..7c2f485 100644 --- a/test/HTML5/Html5Test.php +++ b/test/HTML5/Html5Test.php @@ -147,7 +147,12 @@ public function testEncodingUtf8() $this->assertEmpty($this->html5->getErrors()); $this->assertFalse($this->html5->hasErrors()); - $this->assertContains('Žťčýů', $dom->saveHTML()); + // phpunit 9 + if (method_exists($this, 'assertStringContainsString')) { + $this->assertStringContainsString('Žťčýů', $dom->saveHTML()); + } else { + $this->assertContains('Žťčýů', $dom->saveHTML()); + } } public function testEncodingWindows1252() @@ -427,7 +432,13 @@ public function testElements() public function testAttributes() { $res = $this->cycle(''); - $this->assertContains('', $res); + + // phpunit 9 + if (method_exists($this, 'assertStringContainsString')) { + $this->assertStringContainsString('', $res); + } else { + $this->assertContains('', $res); + } $res = $this->cycle('
FOO
'); $this->assertRegExp('|
FOO
|', $res); @@ -541,9 +552,12 @@ public function testCDATA() public function testAnchorTargetQueryParam() { $res = $this->cycle('https://domain.com/page.php?foo=bar&target=baz'); - $this->assertContains( - 'https://domain.com/page.php?foo=bar&target=baz', - $res - ); + + // phpunit 9 + if (method_exists($this, 'assertStringContainsString')) { + $this->assertStringContainsString('https://domain.com/page.php?foo=bar&target=baz', $res); + } else { + $this->assertContains('https://domain.com/page.php?foo=bar&target=baz', $res); + } } }