public function testIs() { $html = $this->loadFixture('posts.html'); $document = new Document($html, false); $document2 = new Document($html, false); $this->assertTrue($document->is($document)); $this->assertFalse($document->is($document2)); }
public function testIsException() { $this->setExpectedException('InvalidArgumentException'); $document = new Document(); $document->is(null); }
public function testParent() { $html = $this->loadFixture('posts.html'); $document = new Document($html, false); $element = $document->createElement('span', 'value'); $parent = $element->parent(); $this->assertInstanceOf('DiDom\\Document', $parent); $this->assertTrue($document->is($parent)); }