Skip to content

Commit

Permalink
little tests cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
keradus committed Oct 5, 2020
1 parent ccb8923 commit 4d2feff
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions tests/Bundle/CoverallsBundle/Collector/GitInfoCollectorTest.php
Expand Up @@ -120,15 +120,14 @@ public function shouldCollectNoBranch()
*/
public function throwRuntimeExceptionIfCurrentBranchNotFound()
{
$this->expectException(\RuntimeException::class);

$getBranchesValue = [
' master',
];
$gitCommand = $this->createGitCommandStubCalledBranches($getBranchesValue);

$object = new GitInfoCollector($gitCommand);

$this->expectException(\RuntimeException::class);
$object->collect();
}

Expand All @@ -139,13 +138,12 @@ public function throwRuntimeExceptionIfCurrentBranchNotFound()
*/
public function throwRuntimeExceptionIfHeadCommitIsInvalid()
{
$this->expectException(\RuntimeException::class);

$getHeadCommitValue = [];
$gitCommand = $this->createGitCommandStubCalledHeadCommit($this->getBranchesValue, $getHeadCommitValue);

$object = new GitInfoCollector($gitCommand);

$this->expectException(\RuntimeException::class);
$object->collect();
}

Expand All @@ -156,13 +154,12 @@ public function throwRuntimeExceptionIfHeadCommitIsInvalid()
*/
public function throwRuntimeExceptionIfRemoteIsInvalid()
{
$this->expectException(\RuntimeException::class);

$getRemotesValue = [];
$gitCommand = $this->createGitCommandStubWith($this->getBranchesValue, $this->getHeadCommitValue, $getRemotesValue);

$object = new GitInfoCollector($gitCommand);

$this->expectException(\RuntimeException::class);
$object->collect();
}

Expand Down Expand Up @@ -275,8 +272,6 @@ protected function setUpGitCommandStubWithGetRemotesNeverCalled($stub)

protected function assertGit(Git $git)
{
$this->assertSame('branch1', $git->getBranch());

$commit = $git->getHead();

$this->assertInstanceOf(Commit::class, $commit);
Expand Down

0 comments on commit 4d2feff

Please sign in to comment.