Skip to content

Commit

Permalink
chore: allow phpunit 9
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris8934 committed Mar 31, 2024
1 parent 4c3dc08 commit e7edf89
Showing 1 changed file with 11 additions and 17 deletions.
28 changes: 11 additions & 17 deletions test/HTML5/Html5Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,11 @@ public function testEncodingUtf8()
$this->assertEmpty($this->html5->getErrors());
$this->assertFalse($this->html5->hasErrors());

# phpunit 9
if(method_exists($this, 'assertStringContainsString'))
{
$this->assertStringContainsString('Žťčýů', $dom->saveHTML());
}
else{
$this->assertContains('Žťčýů', $dom->saveHTML());
// phpunit 9
if(method_exists($this, 'assertStringContainsString')) {
$this->assertStringContainsString('Žťčýů', $dom->saveHTML());
} else {
$this->assertContains('Žťčýů', $dom->saveHTML());
}
}

Expand Down Expand Up @@ -381,12 +379,10 @@ public function testAttributes()
{
$res = $this->cycle('<use xlink:href="#svg-track" xmlns:xlink="http://www.w3.org/1999/xlink"></use>');

# phpunit 9
if(method_exists($this, 'assertStringContainsString'))
{
// phpunit 9
if(method_exists($this, 'assertStringContainsString')) {
$this->assertStringContainsString('<use xlink:href="#svg-track" xmlns:xlink="http://www.w3.org/1999/xlink"></use>', $res);
}
else{
} else {
$this->assertContains('<use xlink:href="#svg-track" xmlns:xlink="http://www.w3.org/1999/xlink"></use>', $res);
}

Expand Down Expand Up @@ -503,12 +499,10 @@ public function testAnchorTargetQueryParam()
{
$res = $this->cycle('<a href="https://domain.com/page.php?foo=bar&target=baz">https://domain.com/page.php?foo=bar&target=baz</a>');

# phpunit 9
if(method_exists($this, 'assertStringContainsString'))
{
// phpunit 9
if(method_exists($this, 'assertStringContainsString')) {
$this->assertStringContainsString('<a href="https://domain.com/page.php?foo=bar&amp;target=baz">https://domain.com/page.php?foo=bar&amp;target=baz</a>', $res);
}
else{
} else {
$this->assertContains('<a href="https://domain.com/page.php?foo=bar&amp;target=baz">https://domain.com/page.php?foo=bar&amp;target=baz</a>', $res);
}
}
Expand Down

0 comments on commit e7edf89

Please sign in to comment.