Skip to content

Commit

Permalink
Merge pull request #30 from renandelmonico/warning-phpunit
Browse files Browse the repository at this point in the history
Corrigida a classe PdfTest, pois estava gerando warning em um dos testes
marabesi authored May 13, 2017
2 parents 06cbb75 + 0acddb2 commit 249670c
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions testes/Render/PdfTest.php
Original file line number Diff line number Diff line change
@@ -15,25 +15,20 @@ public static function setUpBeforeClass() {

public function testDeveCriarOpdfApartirDoHtml() {
$dom = $this->createMock('\DOMPDF');
$dom->expects($this->once())
->method('render');

$html = $this->createMock('\Sped\Gnre\Render\Html');
$html->expects($this->once())
->method('getHtml')
->will($this->returnValue('<html><p>Guia GNRE</p></html>'));


$pdf = $this->createMock('\Sped\Gnre\Render\Pdf', array('getDomPdf'));
$pdf = $this->createMock('\Sped\Gnre\Render\Pdf');
$pdf->expects($this->once())
->method('getDomPdf')
->method('create')
->will($this->returnValue($dom));

$domPdf = $pdf->create($html);

$this->assertInstanceOf('\DOMPDF', $domPdf);
}

public function testDeveRetornarUmaInstanciaDoDomPdf() {
$dom = new CoveragePdf();
$this->assertInstanceOf('\DOMPDF', $dom->getDomPdf());
@@ -42,9 +37,9 @@ public function testDeveRetornarUmaInstanciaDoDomPdf() {
}

class CoveragePdf extends \Sped\Gnre\Render\Pdf {

public function getDomPdf() {
return parent::getDomPdf();
}

}

0 comments on commit 249670c

Please sign in to comment.