Пример #1
0
 public function testHandle()
 {
     $data = json_decode(file_get_contents(__DIR__ . '/stubs/ping.json'), true);
     $handler = new GitHubPingHandler($log = Mockery::mock(LoggerInterface::class));
     AutoPresenter::shouldReceive('decorate')->once()->with($repo = new Repo())->andReturn($presenter = Mockery::mock(RepoPresenter::class));
     $presenter->shouldReceive('toArray')->once()->andReturn($presented = ['id' => 26929642, 'name' => 'StyleCI/StyleCI']);
     $log->shouldReceive('info')->once()->with('Received ping from GitHub.', ['data' => $data, 'repo' => $presented]);
     $this->assertNull($handler->handle(new GitHubPingEvent($repo, $data)));
 }