getType() public method

Returns the type of document (XML or HTML).
public getType ( ) : string
return string
Example #1
0
 public function testGetType()
 {
     $document = new Document();
     $this->assertNull($document->getType());
     $html = $this->loadFixture('posts.html');
     $document = new Document($html);
     $this->assertEquals('html', $document->getType());
     $xml = $this->loadFixture('books.xml');
     $document = new Document($xml, false, 'UTF-8', 'xml');
     $this->assertEquals('xml', $document->getType());
 }