Example #1
0
 public function it_will_create_remote_commit_value_object(PushPayload $pushPayload)
 {
     $data = ['id' => 'sha', 'message' => 'Message', 'timestamp' => '2015-11-20T22:25:30+01:00'];
     $pushPayload->getHeadCommitDetails()->willReturn($data);
     $result = $this->create($pushPayload);
     $result->shouldReturnAnInstanceOf('DevBoard\\GithubRemote\\ValueObject\\Commit\\Commit');
     $result->getSha()->shouldReturn('sha');
     $result->getMessage()->shouldReturn('Message');
 }
Example #2
0
 /**
  * @param PushPayload $pushPayload
  *
  * @return Commit
  */
 public function create(PushPayload $pushPayload)
 {
     $data = $pushPayload->getHeadCommitDetails();
     return new Commit($data['id'], new DateTime($data['timestamp']), new DateTime($data['timestamp']), $data['message']);
 }