KnpLabs/php-github-api

Question: How can I mock this package?

edalzell opened this issue · 1 comments

Trying to test my code without calling GitHub, and I'm having difficulty mocking the api.

I have this:

        $mock = Mockery::mock(Client::class);
        $mock->shouldReceive('api->create')->andReturn(123);

But when I do this:

        github()->api('repo')->create('my-new-repo', 'This is the description of a repo', 'http://my-repo-homepage.org', true);

It's actually trying to make the call to GitHub.

How can I properly mock this?

Thanks!

PEBKAC