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 357a84d commit d0c46ae
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions tests/AttrTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php declare(strict_types=1);

namespace s9e\SweetDOM\Tests;

use PHPUnit\Framework\Attributes\CoversClass;
use PHPUnit\Framework\TestCase;
use s9e\SweetDOM\Document;

#[CoversClass('s9e\SweetDOM\Attr')]
#[CoversClass('s9e\SweetDOM\NodeTraits\NodePolyfill')]
class AttrTest extends TestCase
{
public function testIsEqualNode()
{
$dom = new Document;
$dom->loadXML('<x><y a="" b="b" c="c"/><z a="a" b="b" c=""/></x>');

$this->assertFalse($dom->firstOf('//y/@a')->isEqualNode($dom->firstOf('//z/@a')));
$this->assertFalse($dom->firstOf('//y/@a')->isEqualNode($dom->firstOf('//z/@b')));
$this->assertFalse($dom->firstOf('//y/@a')->isEqualNode($dom->firstOf('//z/@c')));
$this->assertFalse($dom->firstOf('//y/@b')->isEqualNode($dom->firstOf('//z/@a')));
$this->assertTrue($dom->firstOf('//y/@b')->isEqualNode($dom->firstOf('//z/@b')));
$this->assertFalse($dom->firstOf('//y/@b')->isEqualNode($dom->firstOf('//z/@c')));
$this->assertFalse($dom->firstOf('//y/@c')->isEqualNode($dom->firstOf('//z/@a')));
$this->assertFalse($dom->firstOf('//y/@c')->isEqualNode($dom->firstOf('//z/@b')));
$this->assertFalse($dom->firstOf('//y/@c')->isEqualNode($dom->firstOf('//z/@c')));
}
}

0 comments on commit d0c46ae

Please sign in to comment.