omise / omise-php

Omise PHP library
https://docs.opn.ooo
MIT License
67 stars 41 forks source link

Hard to unit test code using this package #40

Open tanigami opened 8 years ago

tanigami commented 8 years ago

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?

guzzilar commented 7 years ago

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 7 years ago

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