@@ -42,9 +42,10 @@ public function testReportsProjectMetadataWithoutAStaticBranchList(string $versi
4242 self ::assertFalse ($ result ['project ' ]['debug ' ]);
4343 }
4444
45- public function testReportsBranchesMissingFromReleaseMetadataWithoutBootingTheApplication (): void
45+ #[DataProvider('unsupportedBranchProvider ' )]
46+ public function testReportsBranchesOutsideTheReleaseMetadataRangeWithoutBootingTheApplication (string $ version , string $ branch ): void
4647 {
47- (new AutoloaderFixtureBuilder ($ this ->workspace ))->writeAutoloader (' 5.4.45 ' );
48+ (new AutoloaderFixtureBuilder ($ this ->workspace ))->writeAutoloader ($ version );
4849 $ metadata = $ this ->workspace ->write ('releases.json ' , json_encode ([
4950 'supported_versions ' => ['6.4 ' , '7.4 ' , '8.1 ' ],
5051 ], \JSON_THROW_ON_ERROR ));
@@ -60,11 +61,28 @@ public function testReportsBranchesMissingFromReleaseMetadataWithoutBootingTheAp
6061 self ::assertTrue ($ process ->snapshot ['unsupportedSymfonyVersion ' ] ?? false );
6162 $ project = $ process ->snapshot ['project ' ] ?? null ;
6263 self ::assertIsArray ($ project );
63- self ::assertSame (' 5.4 ' , $ project ['symfonyBranch ' ] ?? null );
64+ self ::assertSame ($ branch , $ project ['symfonyBranch ' ] ?? null );
6465 self ::assertArrayNotHasKey ('configurationValidation ' , $ process ->snapshot );
6566 self ::assertSame ((string ) file_get_contents ($ metadata ), (string ) file_get_contents ($ cache ));
6667 }
6768
69+ public function testAcceptsIntermediateBranchesWithinTheReleaseMetadataRange (): void
70+ {
71+ (new AutoloaderFixtureBuilder ($ this ->workspace ))->writeAutoloader ('8.0.13 ' );
72+ $ metadata = $ this ->workspace ->write ('releases.json ' , json_encode ([
73+ 'supported_versions ' => ['8.1 ' , '6.4 ' , '7.4 ' ],
74+ ], \JSON_THROW_ON_ERROR ));
75+
76+ $ process = $ this ->bridge ->run ([
77+ '--release-metadata-url= ' .$ metadata ,
78+ '--release-metadata-cache= ' .$ this ->workspace ->path .'/release-metadata-cache.json ' ,
79+ ]);
80+
81+ self ::assertSame (0 , $ process ->exitCode , $ process ->stderr ."\n" .$ process ->stdout );
82+ self ::assertIsArray ($ process ->snapshot );
83+ self ::assertArrayNotHasKey ('unsupportedSymfonyVersion ' , $ process ->snapshot );
84+ }
85+
6886 public function testUsesStaleReleaseMetadataWhenRefreshFails (): void
6987 {
7088 (new AutoloaderFixtureBuilder ($ this ->workspace ))->writeAutoloader ('5.4.45 ' );
@@ -131,6 +149,13 @@ public static function versionProvider(): iterable
131149 yield 'prerelease ' => ['42.7.0-RC1 ' ];
132150 }
133151
152+ /** @return iterable<string, array{string, string}> */
153+ public static function unsupportedBranchProvider (): iterable
154+ {
155+ yield 'older ' => ['5.4.45 ' , '5.4 ' ];
156+ yield 'newer ' => ['8.2.0-BETA1 ' , '8.2 ' ];
157+ }
158+
134159 public function testKeepsStrayProjectOutputOffTheStdoutPayload (): void
135160 {
136161 (new AutoloaderFixtureBuilder ($ this ->workspace ))->writeStrayOutputApplication ();
0 commit comments