Mock Codebird so we don’t need to pass tokens to travis

This commit is contained in:
Jonny Barnes 2019-10-27 18:41:56 +00:00
parent 66242b2c38
commit 876f763369

View file

@ -194,6 +194,17 @@ END;
$client = new Client(['handler' => $handler]); $client = new Client(['handler' => $handler]);
$this->app->bind(Client::class, $client); $this->app->bind(Client::class, $client);
$info = new stdClass();
$info->author_name = 'Jonny Barnes';
$info->author_url = 'https://twitter.com/jonnybarnes';
$info->html = '<div>HTML of the tweet embed</div>';
$codebirdMock = $this->getMockBuilder(Codebird::class)
->addMethods(['statuses_oembed'])
->getMock();
$codebirdMock->method('statuses_oembed')
->willReturn($info);
$this->app->instance(Codebird::class, $codebirdMock);
$authorship = new Authorship(); $authorship = new Authorship();
$job->handle($client, $authorship); $job->handle($client, $authorship);