Skip to content

Commit

Permalink
WiP
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshyPHP committed Dec 28, 2023
1 parent ef95d34 commit 235be3a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/NodeComparator.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class NodeComparator
// https://github.com/php/php-src/blob/master/ext/dom/node.c
public static function isEqualNode(?DOMNode $node, ?DOMNode $otherNode): bool
{
if (!isset($node, $otherNode) || $node->nodeType !== $otherNode->nodeType || $node->nodeName !== $otherNode->nodeName)
if (!isset($node, $otherNode) || $node->nodeType !== $otherNode->nodeType)
{
return false;
}
Expand Down
12 changes: 6 additions & 6 deletions tests/NodeComparatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -381,12 +381,12 @@ public function testIsEqualEntityDeclarationNode()
</html>
EOT);

$this->assertIsEqualNode(true, $dom1->doctype->entities['bar'], $dom2->doctype->entities['bar']);
$this->assertIsEqualNode(false, $dom1->doctype->entities['bar'], $dom2->doctype->entities['barbar']);
$this->assertIsEqualNode(false, $dom1->doctype->entities['bar'], $dom2->doctype->entities['foo']);
$this->assertIsEqualNode(false, $dom1->doctype->entities['foo'], $dom2->doctype->entities['bar']);
$this->assertIsEqualNode(false, $dom1->doctype->entities['foo'], $dom2->doctype->entities['barbar']);
$this->assertIsEqualNode(true, $dom1->doctype->entities['foo'], $dom2->doctype->entities['foo']);
$this->assertIsEqualNode(true, $dom1->doctype->entities->getNamedItem('bar'), $dom2->doctype->entities->getNamedItem('bar'));
$this->assertIsEqualNode(false, $dom1->doctype->entities->getNamedItem('bar'), $dom2->doctype->entities->getNamedItem('barbar'));
$this->assertIsEqualNode(false, $dom1->doctype->entities->getNamedItem('bar'), $dom2->doctype->entities->getNamedItem('foo'));
$this->assertIsEqualNode(false, $dom1->doctype->entities->getNamedItem('foo'), $dom2->doctype->entities->getNamedItem('bar'));
$this->assertIsEqualNode(false, $dom1->doctype->entities->getNamedItem('foo'), $dom2->doctype->entities->getNamedItem('barbar'));
$this->assertIsEqualNode(true, $dom1->doctype->entities->getNamedItem('foo'), $dom2->doctype->entities->getNamedItem('foo'));
}

public function testIsEqualEntityNotationNode()
Expand Down

0 comments on commit 235be3a

Please sign in to comment.