Skip to content

Commit

Permalink
Fix Mock Tests (PDFBuilder)
Browse files Browse the repository at this point in the history
  • Loading branch information
HorstOeko committed Oct 9, 2023
1 parent 8090763 commit a005202
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions tests/testcases/PdfBuilderEn16931Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,17 +140,15 @@ public function testGetXmlContent(): void
->getMock();

/**
* @var \PHPUnit\Framework\MockObject\MockObject
* @var \PHPUnit\Framework\MockObject\MockObject $mockedObject
*/
$mockedObject = $mockedObject;
$mockedObject->expects($this->exactly(2))
->method("getXmlContent")
->willReturn(self::$document->getContent());

/**
* @var \horstoeko\zugferd\ZugferdDocumentPdfBuilder
* @var \horstoeko\zugferd\ZugferdDocumentPdfBuilder $mockedObject
*/
$mockedObject = $mockedObject;
$result = $mockedObject->generateDocument();

$this->assertInstanceOf(ZugferdDocumentPdfBuilder::class, $result);
Expand All @@ -171,17 +169,15 @@ public function testGetXmlAttachmentFilename(): void
->getMock();

/**
* @var \PHPUnit\Framework\MockObject\MockObject
* @var \PHPUnit\Framework\MockObject\MockObject $mockedObject
*/
$mockedObject = $mockedObject;
$mockedObject->expects($this->exactly(2))
->method("getXmlAttachmentFilename")
->willReturn(self::$document->getProfileDefinition()['attachmentfilename']);

/**
* @var \horstoeko\zugferd\ZugferdDocumentPdfBuilder
* @var \horstoeko\zugferd\ZugferdDocumentPdfBuilder $mockedObject
*/
$mockedObject = $mockedObject;
$result = $mockedObject->generateDocument();

$this->assertInstanceOf(ZugferdDocumentPdfBuilder::class, $result);
Expand All @@ -202,17 +198,15 @@ public function testGetXmlAttachmentXmpName(): void
->getMock();

/**
* @var \PHPUnit\Framework\MockObject\MockObject
* @var \PHPUnit\Framework\MockObject\MockObject $mockedObject
*/
$mockedObject = $mockedObject;
$mockedObject->expects($this->exactly(1))
->method("getXmlAttachmentXmpName")
->willReturn(self::$document->getProfileDefinition()["xmpname"]);

/**
* @var \horstoeko\zugferd\ZugferdDocumentPdfBuilder
* @var \horstoeko\zugferd\ZugferdDocumentPdfBuilder $mockedObject
*/
$mockedObject = $mockedObject;
$result = $mockedObject->generateDocument();

$this->assertInstanceOf(ZugferdDocumentPdfBuilder::class, $result);
Expand Down

0 comments on commit a005202

Please sign in to comment.