[Cloud Tasks] Testing after release v2.0.0 #8014
Unanswered
Daniel-I-Am
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I maintain a small helper library in-house to allow our development team to not worry about the Google code and differences between development environment (locally) and production (GCP) by implementing the Psr-18 standard with an implementation using Cloud Tasks. We depend on Cloud Tasks for production use, but fall back to a simple HTTP Client implementation for development.
V2 of the Cloud Tasks library was released a couple days ago with some major changes. The most important one for me being that the Client class was marked
final
therefor no longer mockable in unit tests. From what I can tell there is no interface to allow mocking either.I have a simple question, how can I test code interacting with the Cloud Tasks client library using PHPUnit now?
Here's a sample of a test I had before, which is no longer possible with the new
final
Google\Cloud\Tasks\V2\Client\CloudTasksClient
, as far as I know:Beta Was this translation helpful? Give feedback.
All reactions