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(); });