1717use Rollerworks \Component \Version \ContinuesVersionsValidator ;
1818use Rollerworks \Component \Version \Version ;
1919
20+ /**
21+ * @internal
22+ */
2023class ContinuesVersionsValidatorTest extends TestCase
2124{
22- /**
23- * @return iterable<int, string[]>
24- */
25+ /** @return iterable<int, string[]> */
2526 public static function provideInitialContinuesVersions (): iterable
2627 {
2728 yield ['0.1.0 ' ];
@@ -31,8 +32,9 @@ public static function provideInitialContinuesVersions(): iterable
3132 }
3233
3334 /**
34- * @test
3535 * @dataProvider provideInitialContinuesVersions
36+ *
37+ * @test
3638 */
3739 public function it_accepts_a_continues_version_with_no_pre_existing (string $ new ): void
3840 {
@@ -50,9 +52,7 @@ public function it_accepts_a_continues_version_with_no_pre_existing(string $new)
5052 );
5153 }
5254
53- /**
54- * @return iterable<string, array<int, string[]|string>>
55- */
55+ /** @return iterable<string, array<int, string[]|string>> */
5656 public static function provideContinuesVersions (): iterable
5757 {
5858 yield 'unstable #1 ' => ['0.3 ' , ['0.2 ' , '0.1 ' ], ['0.2.1 ' , '0.3 ' , '1.0-BETA1 ' , '1.0 ' ]];
@@ -67,17 +67,18 @@ public static function provideContinuesVersions(): iterable
6767 }
6868
6969 /**
70- * @test
7170 * @dataProvider provideContinuesVersions
7271 *
7372 * @param array<int, string> $existing
7473 * @param array<int, string> $possible
74+ *
75+ * @test
7576 */
7677 public function it_accepts_a_continues_version (string $ new , array $ existing , array $ possible ): void
7778 {
7879 $ validator = new ContinuesVersionsValidator (...$ this ->createVersions ($ existing ));
7980
80- self ::assertTrue ($ validator ->isContinues (Version::fromString ($ new )), sprintf ('Excepts instead %s ' , implode (', ' , $ validator ->getPossibleVersions ())));
81+ self ::assertTrue ($ validator ->isContinues (Version::fromString ($ new )), \ sprintf ('Excepts instead %s ' , implode (', ' , $ validator ->getPossibleVersions ())));
8182 self ::assertEquals ($ this ->createVersions ($ possible ), array_merge ([], $ validator ->getPossibleVersions ()));
8283 }
8384
@@ -89,16 +90,14 @@ public function it_accepts_a_continues_version(string $new, array $existing, arr
8990 private function createVersions (array $ existing ): array
9091 {
9192 return array_map (
92- function (string $ version ) {
93+ static function (string $ version ) {
9394 return Version::fromString ($ version );
9495 },
9596 $ existing
9697 );
9798 }
9899
99- /**
100- * @return iterable<int, string[]>
101- */
100+ /** @return iterable<int, string[]> */
102101 public static function provideNotInitialContinuesVersions (): iterable
103102 {
104103 yield ['0.2.0 ' ];
@@ -109,8 +108,9 @@ public static function provideNotInitialContinuesVersions(): iterable
109108 }
110109
111110 /**
112- * @test
113111 * @dataProvider provideNotInitialContinuesVersions
112+ *
113+ * @test
114114 */
115115 public function it_rejects_non_continues_version_with_no_pre_existing (string $ new ): void
116116 {
@@ -128,9 +128,7 @@ public function it_rejects_non_continues_version_with_no_pre_existing(string $ne
128128 );
129129 }
130130
131- /**
132- * @return iterable<string, array<int, string[]|string>>
133- */
131+ /** @return iterable<string, array<int, string[]|string>> */
134132 public static function provideNonContinuesVersions (): iterable
135133 {
136134 yield 'unstable #1 ' => ['0.5 ' , ['0.2 ' , '0.1 ' ], ['0.2.1 ' , '0.3 ' , '1.0-BETA1 ' , '1.0 ' ]];
@@ -146,11 +144,12 @@ public static function provideNonContinuesVersions(): iterable
146144 }
147145
148146 /**
149- * @test
150147 * @dataProvider provideNonContinuesVersions
151148 *
152149 * @param array<int, string> $existing
153150 * @param array<int, string> $possible
151+ *
152+ * @test
154153 */
155154 public function it_rejects_non_continues_version (string $ new , array $ existing , array $ possible ): void
156155 {
0 commit comments