createMock('Spipu\Html2Pdf\Extension\ExtensionInterface');
$extension->expects($this->any())->method('getName')->willReturn('test');
$extension->expects($this->any())->method('getTags')->willReturn(array($tag));
$object = $this->getObject();
$object->addExtension($extension);
$object->writeHTML('
Hello
');
$this->assertTrue(true);
}
public function testSecurityGoodImg()
{
$object = $this->getObject();
$object->getSecurityService()->addAllowedHost('www.spipu.net');
$object->setTestIsImage(false);
$object->writeHTML('');
$object->writeHTML('');
$object->writeHTML('');
// Ensures we assert something
$this->assertTrue(true);
}
public function testSecurityGoodBackground()
{
$object = $this->getObject();
$object->getSecurityService()->addAllowedHost('www.spipu.net');
$object->setTestIsImage(false);
$object->writeHTML('');
$object->writeHTML('');
$object->writeHTML('');
// Ensures we assert something
$this->assertTrue(true);
}
public function testSecurityKoImg()
{
$this->expectException(HtmlParsingException::class);
$this->expectExceptionMessage('Unauthorized path scheme', HtmlParsingException::class);
$object = $this->getObject();
$object->writeHTML('');
}
public function testSecurityKoBackground()
{
$this->expectException(HtmlParsingException::class);
$this->expectExceptionMessage('Unauthorized path scheme', HtmlParsingException::class);
$object = $this->getObject();
$object->writeHTML('');
}
}
class testTag extends AbstractTag
{
public function getName()
{
return 'test_tag';
}
public function open($properties)
{
}
public function close($properties)
{
}
}