assertInstanceOf(DoctypeInterface::class, $document->doctype()); $this->assertInstanceOf(HtmlTagInterface::class, $document->html()); $this->assertInstanceOf(BodyTagInterface::class, $document->body()); $this->assertInstanceOf(HeadTagInterface::class, $document->head()); // body and head are being passed properly $this->assertEquals($document->body(), $document->html()->body()); $this->assertEquals($document->head(), $document->html()->head()); // everything has the correct document $this->assertEquals($document, $document->doctype()->parentDocument()); $this->assertEquals($document, $document->html()->parentDocument()); $this->assertEquals($document, $document->body()->parentDocument()); $this->assertEquals($document, $document->head()->parentDocument()); // string version of an empty document $this->assertEquals( implode( PHP_EOL, [ '', '', '', 'Untitled', '', '', '' ] ), $document->__toString() ); } }