How to mock during unittests?

Hi there,

I once asked if the final keyword could be removed from the lib functions and replaced with @final annotation, so we can mock the libs during testing, and the answer that i got was “We have interfaces for all classes”. Which means i should be able to create wrapper classes implementing the interfaces and then mock my own classes. Not super convenient, but ok.

Now i checked and the interface for the SdkConfiguration for example looks like this:

interface ConfigurableContract
{
}

So i’m not totally getting how exactly this should help me mocking the lib during testing. There are a bunch of other threads around this topic like
How to mock auth0 calls in unit testing to avoid calling the api to many times for example, and the answer there us super generic and not helpful at all. Can you please provide a concrete example of how to mock the management API using those empty interfaces? A code snippet would be great.

Cheers!

Side-note: I cannot tag this with auth0-php and any other tag, but i have to give it at least 2 tags… Ehm…?

Refs: