44
55namespace Syntatis \Tests \Commands ;
66
7+ use Syntatis \Tests \Commands \CommandTestCase ;
78use PHPUnit \Framework \TestCase ;
89use Symfony \Component \Console \Tester \CommandTester ;
910use Syntatis \Version \CLI \Commander ;
1011
1112use function sprintf ;
1213
13- class IncrementCommandTest extends TestCase
14+ class IncrementCommandTest extends CommandTestCase
1415{
1516 private Commander $ commander ;
1617 private CommandTester $ tester ;
@@ -30,7 +31,7 @@ public function testInvalidVersionArgument(string $version): void
3031
3132 self ::assertStringContainsString (
3233 sprintf ("[ERROR] Version string '%s' is not valid and cannot be parsed " , $ version ),
33- $ this ->tester ->getDisplay (),
34+ self :: normalizeOutput ( $ this ->tester ->getDisplay () ),
3435 );
3536 }
3637
@@ -40,7 +41,7 @@ public function testIncrementPatch(): void
4041
4142 self ::assertStringContainsString (
4243 '1.0.1 ' ,
43- $ this ->tester ->getDisplay (),
44+ self :: normalizeOutput ( $ this ->tester ->getDisplay () ),
4445 );
4546 }
4647
@@ -50,7 +51,7 @@ public function testIncrementMinor(): void
5051
5152 self ::assertStringContainsString (
5253 '1.1.0 ' ,
53- $ this ->tester ->getDisplay (),
54+ self :: normalizeOutput ( $ this ->tester ->getDisplay () ),
5455 );
5556 }
5657
@@ -60,7 +61,7 @@ public function testIncrementMajor(): void
6061
6162 self ::assertStringContainsString (
6263 '2.0.0 ' ,
63- $ this ->tester ->getDisplay (),
64+ self :: normalizeOutput ( $ this ->tester ->getDisplay () ),
6465 );
6566 }
6667
@@ -70,7 +71,7 @@ public function testIncrementWithBuildMetadata(): void
7071
7172 self ::assertStringContainsString (
7273 '1.0.1+123 ' ,
73- $ this ->tester ->getDisplay (),
74+ self :: normalizeOutput ( $ this ->tester ->getDisplay () ),
7475 );
7576 }
7677
@@ -80,7 +81,7 @@ public function testIncrementWithPreRelease(): void
8081
8182 self ::assertStringContainsString (
8283 '1.0.1-beta ' ,
83- $ this ->tester ->getDisplay (),
84+ self :: normalizeOutput ( $ this ->tester ->getDisplay () ),
8485 );
8586 }
8687
@@ -93,7 +94,7 @@ public function testIncrementPrerelease(string $version, string $expect): void
9394
9495 self ::assertStringContainsString (
9596 $ expect ,
96- $ this ->tester ->getDisplay (),
97+ self :: normalizeOutput ( $ this ->tester ->getDisplay () ),
9798 );
9899 }
99100
@@ -109,7 +110,7 @@ public function testIncrementPrereleaseWithPreTag(): void
109110
110111 self ::assertStringContainsString (
111112 "[ERROR] Specifying a prerelease tag when incrementing the prerelease part is not allowed. " ,
112- $ this ->tester ->getDisplay (),
113+ self :: normalizeOutput ( $ this ->tester ->getDisplay () ),
113114 );
114115 }
115116
@@ -119,7 +120,7 @@ public function testIncrementPrereleaseWithoutReleaseTag(): void
119120
120121 self ::assertStringContainsString (
121122 "[ERROR] Unable to increment prerelease on a version without a prerelease tag. " ,
122- $ this ->tester ->getDisplay (),
123+ self :: normalizeOutput ( $ this ->tester ->getDisplay () ),
123124 );
124125 }
125126
0 commit comments