File tree Expand file tree Collapse file tree 1 file changed +10
-5
lines changed
Expand file tree Collapse file tree 1 file changed +10
-5
lines changed Original file line number Diff line number Diff line change 1212use Aternos \ModrinthApi \Client \Options \Facets \FacetType ;
1313use Aternos \ModrinthApi \Client \Options \ProjectSearchOptions ;
1414use Aternos \ModrinthApi \Client \SearchProject ;
15+ use Aternos \ModrinthApi \Client \Tags \GameVersion ;
1516use PHPUnit \Framework \TestCase ;
1617
1718class ClientTest extends TestCase
@@ -382,14 +383,18 @@ public function testGetLoaders(): void
382383
383384 public function testGetGameVersions (): void
384385 {
385- $ items = $ this ->apiClient ->getGameVersions ();
386- $ this ->assertNotEmpty ($ items );
386+ $ gameVersions = $ this ->apiClient ->getGameVersions ();
387+ $ this ->assertNotEmpty ($ gameVersions );
387388
388- foreach ($ items as $ item ) {
389- $ this ->assertNotNull ($ item );
389+ foreach ($ gameVersions as $ gameVersion ) {
390+ $ this ->assertNotNull ($ gameVersion );
390391 }
391392
392- $ projects = $ items [0 ]->searchProjects ();
393+ $ latestRelease = array_find ($ gameVersions , function (GameVersion $ gameVersion ) {
394+ return $ gameVersion ->getData ()->getVersionType () === "release " ;
395+ });
396+
397+ $ projects = $ latestRelease ->searchProjects ();
393398 $ this ->assertNotEmpty ($ projects );
394399 foreach ($ projects as $ project ) {
395400 $ this ->assertNotNull ($ project );
You can’t perform that action at this time.
0 commit comments