Skip to content

Commit a998b83

Browse files
committed
Merge branch 'master' into add-return-type-void-to-test-functions
# Conflicts: # tests/Integration/Client/ClientTest.php
2 parents 0b1fd8c + e3a92ec commit a998b83

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

tests/Integration/Client/ClientTest.php

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Aternos\ModrinthApi\Client\Options\Facets\FacetType;
1313
use Aternos\ModrinthApi\Client\Options\ProjectSearchOptions;
1414
use Aternos\ModrinthApi\Client\SearchProject;
15+
use Aternos\ModrinthApi\Client\Tags\GameVersion;
1516
use PHPUnit\Framework\TestCase;
1617

1718
class 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);

0 commit comments

Comments
 (0)