mirror of
https://github.com/sp-tarkov/forge.git
synced 2025-02-13 04:30:41 -05:00
Refringe
09771d233a
Updated the mod filter page to only show SPT versions that have been tagged by mod versions.
33 lines
1.2 KiB
PHP
33 lines
1.2 KiB
PHP
<?php
|
|
|
|
use App\Models\SptVersion;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
it("returns true if the version is part of the latest version's minor releases", function () {
|
|
SptVersion::factory()->create(['version' => '1.1.1']);
|
|
SptVersion::factory()->create(['version' => '1.2.0']);
|
|
$version = SptVersion::factory()->create(['version' => '1.3.0']);
|
|
SptVersion::factory()->create(['version' => '1.3.2']);
|
|
SptVersion::factory()->create(['version' => '1.3.3']);
|
|
|
|
expect($version->isLatestMinor())->toBeTrue();
|
|
});
|
|
|
|
it("returns false if the version is not part of the latest version's minor releases", function () {
|
|
SptVersion::factory()->create(['version' => '1.1.1']);
|
|
SptVersion::factory()->create(['version' => '1.2.0']);
|
|
$version = SptVersion::factory()->create(['version' => '1.2.1']);
|
|
SptVersion::factory()->create(['version' => '1.3.2']);
|
|
SptVersion::factory()->create(['version' => '1.3.3']);
|
|
|
|
expect($version->isLatestMinor())->toBeFalse();
|
|
});
|
|
|
|
it('returns false if there is no latest version in the database', function () {
|
|
$version = SptVersion::factory()->make(['version' => '1.0.0']);
|
|
|
|
expect($version->isLatestMinor())->toBeFalse();
|
|
});
|