/** * @covers \NewFrontiers\Framework\Output\FlashMessage::__construct * @covers \NewFrontiers\Framework\Output\FlashMessage::toHtml */ public function testToHtml() { $flashMessage = new FlashMessage("Hallo Welt!", "mystring42"); $html = $flashMessage->toHtml(); $this->assertNotEmpty($html); $dom = new \DOMDocument(); $dom->validateOnParse = true; $isValid = $dom->loadHTML($html); $this->assertTrue($isValid); //check that at least the level or the message is in the output string $this->assertRegExp('/.*(mystring42|Hallo Welt!)+.*/', $html); }