Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Chrome Pdf Bundle Laravel Package

daif/chrome-pdf-bundle

View on GitHub
Deep Wiki
Context7

Testing

Creating mock results

The ChromePdfFileResult class can be instantiated directly for testing purposes since it accepts raw string data:

use Daif\ChromePdfBundle\Builder\Result\ChromePdfFileResult;
use Daif\ChromePdfBundle\Processor\NullProcessor;

$result = new ChromePdfFileResult(
    '%PDF-1.4 fake content',
    new NullProcessor(),
    'attachment',
    'test.pdf',
);

You can use this in your test doubles:

$invoicePdfGenerator
    ->method('getPdfForInvoice')
    ->with($invoiceId)
    ->willReturn(new ChromePdfFileResult(
        file_get_contents(sprintf('%s/fixtures/test_%d.pdf', __DIR__, $invoiceId)),
        new NullProcessor(),
        'attachment',
        'invoice.pdf',
    ))
;
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
emuniq/filament-browser-notifications
syriable/filament-translator
hungnm28/livewire-form
wenprise/eloquent
crudly/encrypted
fadion/bouncy
cuci/prototurk-sdk
gos/pubsub-router-bundle
cuci/prototurk-sdk-symfony
clementtalleu/easyadmin-markdown-bundle
codeflextech/permission-manager
karnoweb/livewire-datepicker
sayedenam/sayed-dashboard
milito/query-filter
apiboxsym/user-bundle
apiboxsym/health-check-bundle
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui