PDF converter * distributed under the OSL-3.0 License * * @package Html2pdf * @author Laurent MINGUET * @copyright 2017 Laurent MINGUET */ namespace Spipu\Html2Pdf\Tests\Parsing; use Spipu\Html2Pdf\Html2Pdf; use Spipu\Html2Pdf\Tests\AbstractTest; /** * Class ParsingTest */ class ParsingTest extends AbstractTest { /** * test: The tag is unknown * * @return void * @expectedException \Spipu\Html2Pdf\Exception\HtmlParsingException */ public function testUnknownTag() { $object = $this->getObject(); $object->writeHTML('Hello World'); $object->output('test.pdf', 'S'); } /** * test: Too many tag closures found * * @return void * @expectedException \Spipu\Html2Pdf\Exception\HtmlParsingException */ public function testTooManyClosuresFound() { $object = $this->getObject(); $object->writeHTML('Hello'); $object->output('test.pdf', 'S'); } /** * test: Tags are closed in a wrong order * * @return void * @expectedException \Spipu\Html2Pdf\Exception\HtmlParsingException */ public function testWrongClosedOrder() { $object = $this->getObject(); $object->writeHTML('Hello'); $object->output('test.pdf', 'S'); } /** * test: The following tag has not been closed * * @return void * @expectedException \Spipu\Html2Pdf\Exception\HtmlParsingException */ public function testNotClosed() { $object = $this->getObject(); $object->writeHTML('Hello'); $object->output('test.pdf', 'S'); } /** * test: The following tags have not been closed * * @return void * @expectedException \Spipu\Html2Pdf\Exception\HtmlParsingException */ public function testNotClosedMore() { $object = $this->getObject(); $object->writeHTML('Hello'); $object->output('test.pdf', 'S'); } /** * test: The HTML tag code provided is invalid * * @return void * @expectedException \Spipu\Html2Pdf\Exception\HtmlParsingException */ public function testInvalidCode() { $object = $this->getObject(); $object->writeHTML('Hello'); $object->output('test.pdf', 'S'); } }