omise/omise-php

Hard to unit test code using this package

Opened this issue · 2 comments

Seems it's required to call static methods to work with this library, which makes it so hard to unit test. Classes are instantiated through their super classes and so they cannot be DI'd from outside straightforward. Wouldn't be very important for billing related libraries like this to be more test-friendly?

Hi, @tanigami

Thank you for your input. Currently I'm working on a new Omise-PHP version, I would consider about this issue also.

However, please feel free If you have any idea on this to input more.

Fyi, I would like to add a Type: Discussion label to this topic that we could have more conversation on this further 🙂.

iwat commented

@tanigami you may need to visit AspectMock, they provide static method mocking which can be a workaround while waiting for a new version.