Skip to content

Commit

Permalink
#66 #72 #73 isolated tag creation to private method
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Jun 4, 2018
1 parent a609052 commit f3d92aa
Showing 1 changed file with 26 additions and 54 deletions.
80 changes: 26 additions & 54 deletions test/e2e/Command/AssertBackwardsCompatibleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -196,24 +196,7 @@ public function testWillRunSuccessfullyOnNoBcBreaks() : void

public function testWillPickTaggedVersionOnNoGivenFrom() : void
{
(new Process(
[
'git',
'checkout',
$this->versions[1],
],
$this->sourcesRepository
))->mustRun();
(new Process(
[
'git',
'tag',
'1.2.3',
'-m',
'First tag',
],
$this->sourcesRepository
))->mustRun();
$this->tagOnVersion('1.2.3', 1);

$check = new Process(
[
Expand Down Expand Up @@ -241,42 +224,8 @@ public function testWillPickTaggedVersionOnNoGivenFrom() : void

public function testWillPickLatestTaggedVersionOnNoGivenFrom() : void
{
(new Process(
[
'git',
'checkout',
$this->versions[1],
],
$this->sourcesRepository
))->mustRun();
(new Process(
[
'git',
'tag',
'2.2.3',
'-m',
'First tag',
],
$this->sourcesRepository
))->mustRun();
(new Process(
[
'git',
'checkout',
$this->versions[3],
],
$this->sourcesRepository
))->mustRun();
(new Process(
[
'git',
'tag',
'1.2.3',
'-m',
'First tag',
],
$this->sourcesRepository
))->mustRun();
$this->tagOnVersion('2.2.3', 1);
$this->tagOnVersion('1.2.3', 3);

$check = new Process(
[
Expand All @@ -301,4 +250,27 @@ public function testWillPickLatestTaggedVersionOnNoGivenFrom() : void
$errorOutput // @TODO https://github.com/Roave/BackwardCompatibilityCheck/issues/79 this looks like a symfony bug - we shouldn't check STDERR, but STDOUT
);
}

private function tagOnVersion(string $tagName, int $version) : void
{
(new Process(
[
'git',
'checkout',
$this->versions[$version],
],
$this->sourcesRepository
))->mustRun();

(new Process(
[
'git',
'tag',
$tagName,
'-m',
'A tag for version ' . $version,
],
$this->sourcesRepository
))->mustRun();
}
}

0 comments on commit f3d92aa

Please sign in to comment.