DocumentMerger example

function D$val): void {
                    static::assertFalse($val);
                }
            );
        $fpdi->expects(static::once())->method('setPrintFooter')
            ->willReturnCallback(
                function D$val): void {
                    static::assertFalse($val);
                }
            );

        $documentMerger = new DocumentMerger(
            $this->createMock(EntityRepository::class),
            $this->createMock(MediaService::class),
            $this->createMock(DocumentGenerator::class),
            $fpdi
        );

        $documentMerger->merge([Uuid::randomHex()], Context::createDefaultContext());
    }
}
static::assertNull($mergeResult);
    }

    public function testMergeNonStaticDocumentsWithoutMedia(): void
    {
        $expectedBlob = 'expected blob';

        $mockFpdi = $this->getMockBuilder(Fpdi::class)->onlyMethods(['Output'])->getMock();
        $mockFpdi->expects(static::once())->method('OutPut')->willReturn($expectedBlob);

        $documentMerger = new DocumentMerger(
            $this->documentRepository,
            $this->getContainer()->get(MediaService::class),
            $this->documentGenerator,
            $mockFpdi,
        );

        $doc1 = Uuid::randomHex();
        $doc2 = Uuid::randomHex();

        $this->documentRepository->create([[
            'id' => $doc1,
            
Home | Imprint | This part of the site doesn't use cookies.