protected function assertGit(Git $git)
 {
     $this->assertEquals('branch1', $git->getBranch());
     $commit = $git->getHead();
     $commitClass = 'Satooshi\\Bundle\\CoverallsV1Bundle\\Entity\\Git\\Commit';
     $this->assertTrue($commit instanceof $commitClass);
     $this->assertCommit($commit);
     $remotes = $git->getRemotes();
     $this->assertCount(1, $remotes);
     $remoteClass = 'Satooshi\\Bundle\\CoverallsV1Bundle\\Entity\\Git\\Remote';
     $this->assertTrue($remotes[0] instanceof $remoteClass);
     $this->assertRemote($remotes[0]);
 }
Example #2
0
 /**
  * @test
  * @depends shouldSetGit
  */
 public function shouldConvertToArrayWithGit($object)
 {
     $remotes = array(new Remote());
     $head = new Commit();
     $git = new Git('master', $head, $remotes);
     $expected = array('git' => $git->toArray(), 'source_files' => array(), 'environment' => array('packagist_version' => Version::VERSION));
     $this->assertSame($expected, $object->toArray());
     $this->assertEquals(json_encode($expected), (string) $object);
 }