Skip to content

Commit

Permalink
Merge pull request #25 from mpociot/analysis-q2QDlB
Browse files Browse the repository at this point in the history
Applied fixes from StyleCI
  • Loading branch information
mpociot committed Mar 9, 2016
2 parents 3eb43da + 0e016f2 commit 9c04b9d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/Mpociot/CaptainHook/Jobs/TriggerWebhooksJob.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ private function resolveCallable($transformer, $defaultMethodName)
} elseif (is_callable($transformer)) {
return $transformer;
}
return function(){};

return function () {};
}

/**
Expand Down
1 change: 0 additions & 1 deletion src/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
return json_encode($eventData);
},


/*
|--------------------------------------------------------------------------
| Webhook response callback
Expand Down
10 changes: 3 additions & 7 deletions tests/LogTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,6 @@ public function testItRemovesWebhooksAfterMaxCount()
]);
}



public function testResponseCallbackReceivesWebhookAndResponse()
{
$provider = $this->app->getProvider('Mpociot\\CaptainHook\\CaptainHookServiceProvider');
Expand All @@ -283,18 +281,18 @@ public function testResponseCallbackReceivesWebhookAndResponse()
$handler = new \GuzzleHttp\Handler\MockHandler([
new \GuzzleHttp\Psr7\Response(200, [
'Content-Type' => 'application/json',
], '{"data":"First data"}')
], '{"data":"First data"}'),
]);

$mock = \Mockery::mock('stdClass');
$mock->shouldReceive('callback')
->once()
->withArgs([
$checkWebhook->toArray(),
Mockery::type('Psr\Http\Message\ResponseInterface')
Mockery::type('Psr\Http\Message\ResponseInterface'),
]);

$this->app['config']->set('captain_hook.response_callback', (function($webhook, $response) use ($mock){
$this->app['config']->set('captain_hook.response_callback', (function ($webhook, $response) use ($mock) {
return $mock->callback($webhook->toArray(), $response);
}));

Expand All @@ -310,8 +308,6 @@ public function testResponseCallbackReceivesWebhookAndResponse()
$test->name = 'Test';
$test->save();
}


}

class LogTestModel extends \Illuminate\Database\Eloquent\Model
Expand Down

0 comments on commit 9c04b9d

Please sign in to comment.