示例#1
0
 /**
  * Gera o PDF através do HTML
  * @param \Sped\Gnre\Render\Html $html
  * @return \DOMPDF
  */
 public function create(Html $html)
 {
     $dompdf = $this->getDomPdf();
     $dompdf->load_html($html->getHtml());
     $dompdf->render();
     return $dompdf;
 }
示例#2
0
 public function testDeveGerarOhtmlDoLoteQuandoPossuirGuias()
 {
     $smarty = $this->getMock('\\Smarty');
     $smarty->expects($this->at(0))->method('assign')->with('guiaViaInfo');
     $smarty->expects($this->at(1))->method('assign')->with('barcode');
     $smarty->expects($this->at(2))->method('assign')->with('guia');
     $smarty->expects($this->at(3))->method('fetch')->with('gnre.tpl')->will($this->returnValue('<html></html>'));
     $smartyFactory = $this->getMock('\\Sped\\Gnre\\Render\\SmartyFactory');
     $smartyFactory->expects($this->once())->method('create')->will($this->returnValue($smarty));
     $html = new Html();
     $html->setSmartyFactory($smartyFactory);
     $lote = new \Sped\Gnre\Sefaz\Lote();
     $lote->addGuia(new \Sped\Gnre\Sefaz\Guia());
     $html->create($lote);
     $this->assertNotEmpty($html->getHtml());
 }
示例#3
0
 public function testDeveRetornarNullSeNaoForCriadoOhtmlDaGuia()
 {
     $html = new \Sped\Gnre\Render\Html();
     $this->assertEmpty($html->getHtml());
 }