php-image-converter
php-image-converter copied to clipboard
Better tests
@peter279k has added PHPUnit tests. That's almost standard nowdays, so it's a good approach. Thanks for that!
- It looks like the current tests are not fully correct.
pngToAvailablImagesProviderandjpgToAvailablImagesProviderdoes the same thing.
https://github.com/jenstornell/php-image-converter/blob/master/tests/ImageConverterTest.php
More tests needed
- [ ] Every format read from (about 4-5 formats)
- [ ] Every format save to (about 4-5 formats)
- [ ] Test with and without the quality argument (output file size should differ)
- [ ] Test to send the quality argument to an image type that does not support it (should be ignored)
- [ ] Test unknown path (should throw error)
- [ ] Test unkown extension (both from and to)
- [ ] Test file permissions on save (should throw error on could not write file)
- [ ] Test file with correct filename but with wrong mimetype (should throw error)
@jenstornell, thank you for your concern.
You're right, the data provider is duplicated and I think we can use the one availableImageProvider to collect the image file path for the test cases :).