public function toElement() { if ($this->document->documentElement === null) { throw new RuntimeException('Cannot convert empty document to Element'); } return new Element($this->document->documentElement); }
public function testToElement() { $html = $this->loadFixture('posts.html'); $document = new Document($html, false); $element = $document->toElement(); $this->assertInstanceOf('DiDom\\Element', $element); }