Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better tests #1

Open
jenstornell opened this issue Apr 27, 2019 · 2 comments
Open

Better tests #1

jenstornell opened this issue Apr 27, 2019 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@jenstornell
Copy link
Collaborator

No description provided.

@peter279k peter279k mentioned this issue Apr 28, 2019
@peter279k peter279k self-assigned this Apr 29, 2019
@peter279k peter279k added the enhancement New feature or request label Apr 29, 2019
@jenstornell
Copy link
Collaborator Author

@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. pngToAvailablImagesProvider and jpgToAvailablImagesProvider does 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)

@peter279k
Copy link
Member

@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 :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants