コード例 #1
0
 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');
 }
コード例 #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');
 }
コード例 #3
0
 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');
 }
コード例 #4
0
ファイル: CommitFactory.php プロジェクト: brankol/devboard
 /**
  * @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']);
 }
コード例 #5
0
ファイル: RepoFactory.php プロジェクト: brankol/devboard
 /**
  * @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']));
 }
コード例 #6
0
 /**
  * @param StatusPayload $statusPayload
  *
  * @return ExternalService
  */
 public function create(StatusPayload $statusPayload)
 {
     return new ExternalService($statusPayload->getContext());
 }
コード例 #7
0
 /**
  * @param StatusPayload $statusPayload
  *
  * @return CommitStatus
  */
 public function create(StatusPayload $statusPayload)
 {
     return new CommitStatus($statusPayload->getState(), $statusPayload->getDescription(), $statusPayload->getTargetUrl());
 }
コード例 #8
0
ファイル: RepoFactorySpec.php プロジェクト: brankol/devboard
 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');
 }