spatie/phpunit-snapshot-assertions

add binary driver for images, videos and other binary files

Closed this issue · 4 comments

Hey,

I have some controller actions returning authorization protected binary files (image, video) or runtime generated binary content (image, zip).
It would be cool if there would be a BinaryDriver which accepts the wanted extension as construct argument. So I would be able to do this:

$this->assertMatchesBinarySnapshot($image, 'jpg');

And it matches with Test__test_image__1.jpg snapshot file.

This would be pretty handy

We'd accept a PR that adds this 👍

I'm on it - just waited for the go. 🚀

After digging through current source I've found that assertMatchesFileSnapshot($file) does exactly this.
So I will close this issue because it's already implemented.