public function it_will_create_remote_external_service_value_object(StatusPayload $statusPayload)
 {
     $statusPayload->getContext()->willReturn('context');
     $result = $this->create($statusPayload);
     $result->shouldReturnAnInstanceOf('DevBoard\\GithubRemote\\ValueObject\\ExternalService\\ExternalService');
     $result->getContext()->shouldReturn('context');
 }
Beispiel #2
0
 public function it_will_create_remote_commit_value_object(StatusPayload $statusPayload)
 {
     $data = ['sha' => 'sha', 'commit' => ['author' => ['date' => '2015-11-30T20:47:39Z'], 'committer' => ['date' => '2015-11-30T20:47:39Z'], 'message' => 'Message']];
     $statusPayload->getCommitDetails()->willReturn($data);
     $result = $this->create($statusPayload);
     $result->shouldReturnAnInstanceOf('DevBoard\\GithubRemote\\ValueObject\\Commit\\Commit');
     $result->getSha()->shouldReturn('sha');
     $result->getMessage()->shouldReturn('Message');
 }
 public function it_will_create_remote_commit_status_value_object(StatusPayload $statusPayload)
 {
     $statusPayload->getState()->willReturn('state');
     $statusPayload->getDescription()->willReturn('description');
     $statusPayload->getTargetUrl()->willReturn('url');
     $result = $this->create($statusPayload);
     $result->shouldReturnAnInstanceOf('DevBoard\\GithubRemote\\ValueObject\\CommitStatus\\CommitStatus');
     $result->getStatus()->shouldReturn('state');
     $result->getDescription()->shouldReturn('description');
 }
Beispiel #4
0
 /**
  * @param StatusPayload $statusPayload
  *
  * @return Commit
  */
 public function create(StatusPayload $statusPayload)
 {
     $data = $statusPayload->getCommitDetails();
     return new Commit($data['sha'], new DateTime($data['commit']['author']['date']), new DateTime($data['commit']['committer']['date']), $data['commit']['message']);
 }
Beispiel #5
0
 /**
  * @param StatusPayload $statusPayload
  *
  * @return Repo
  */
 public function create(StatusPayload $statusPayload)
 {
     $data = $statusPayload->getRepositoryDetails();
     return new Repo($data['id'], $data['owner']['login'], $data['name'], $data['full_name'], $data['html_url'], $data['description'], $data['fork'], $data['default_branch'], $data['private'], $data['git_url'], $data['ssh_url'], new DateTime($data['created_at']), new DateTime($data['updated_at']), new DateTime($data['pushed_at']));
 }
 /**
  * @param StatusPayload $statusPayload
  *
  * @return ExternalService
  */
 public function create(StatusPayload $statusPayload)
 {
     return new ExternalService($statusPayload->getContext());
 }
 /**
  * @param StatusPayload $statusPayload
  *
  * @return CommitStatus
  */
 public function create(StatusPayload $statusPayload)
 {
     return new CommitStatus($statusPayload->getState(), $statusPayload->getDescription(), $statusPayload->getTargetUrl());
 }
Beispiel #8
0
 public function it_will_create_remote_repo_value_object(StatusPayload $statusPayload)
 {
     $data = ['id' => 'githubId', 'name' => 'name', 'full_name' => 'owner/name', 'owner' => ['login' => 'owner'], 'html_url' => 'https://github.com/owner/name', 'description' => 'Description', 'fork' => false, 'default_branch' => 'master', 'private' => false, 'git_url' => 'git://github.com/owner/name.git', 'ssh_url' => 'git@github.com:owner/name.git', 'created_at' => '2015-10-17T15:53:45Z', 'updated_at' => '2015-10-17T15:53:45Z', 'pushed_at' => '2015-10-17T15:53:45Z'];
     $statusPayload->getRepositoryDetails()->willReturn($data);
     $this->create($statusPayload)->shouldReturnAnInstanceOf('DevBoard\\GithubRemote\\ValueObject\\Repo\\Repo');
 }