Skip to content

Commit

Permalink
WiP
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Dec 29, 2023
1 parent a28d6a0 commit 5746390
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/CdataSectionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,13 @@ public function testQuery()

$this->assertEquals('z', $dom->firstOf('//text()')->query('.//following-sibling::x')->item(0)->getAttribute('id'));
}

public function testIsEqualNode()
{
$dom = new Document;
$dom->loadXML('<x><![CDATA[..]]><y/><![CDATA[..]]></x>');

$this->assertTrue($dom->firstOf('//x')->firstChild->isEqualNode($dom->firstOf('//x')->lastChild));
$this->assertFalse($dom->firstOf('//x')->firstChild->isEqualNode($dom->firstOf('//y')));
}
}
9 changes: 9 additions & 0 deletions tests/CommentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,13 @@ public function testQuery()

$this->assertEquals('z', $dom->firstOf('//comment()')->query('.//following-sibling::x')->item(0)->getAttribute('id'));
}

public function testIsEqualNode()
{
$dom = new Document;
$dom->loadXML('<x><!--x--><y><!--y--></y><!--x--></x>');

$this->assertTrue($dom->firstOf('//x')->firstChild->isEqualNode($dom->firstOf('//x')->lastChild));
$this->assertFalse($dom->firstOf('//x')->firstChild->isEqualNode($dom->firstOf('//y')->firstChild));
}
}

0 comments on commit 5746390

Please sign in to comment.