Skip to content

Commit

Permalink
Add png save test
Browse files Browse the repository at this point in the history
  • Loading branch information
aalyusuf committed Nov 19, 2024
1 parent fa0f639 commit 58fb198
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/PdfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,22 @@

expect($this->targetPath)->toContainText('hello');
});

it('can save as png in local and disk', function () {
Storage::fake('local');

$firstPath = getTempPath('first.png');
Pdf::view('test')
->save($firstPath);

expect(mime_content_type($firstPath))
->toBe('image/png');

Pdf::view('test')
->disk('local')
->save('second.png');

expect(Storage::disk('local')
->mimeType('second.png'))
->toBe('image/png');
});

0 comments on commit 58fb198

Please sign in to comment.