Add setting to include transfer hours in calculations (#350)

* Add setting to include transfer hours in calculations

* Add some extra tests to check versions

* A couple of more version test cases
This commit is contained in:
Nabeel S
2019-08-08 12:50:43 -04:00
committed by GitHub
parent ff6ba4c29a
commit a08c9db284
12 changed files with 169 additions and 83 deletions

View File

@@ -14,7 +14,26 @@ class VersionTest extends TestCase
$this->kvpRepo = app(KvpRepository::class);
}
public function testGetLatestVersion()
/**
* Test that the new versions (keys) are properly regarded as new versions
*/
public function testGreaterThanVersionStrings(): void
{
$test = [
'7.0.0' => '6.0.0',
'7.0.0-beta' => '7.0.0-alpha',
'7.0.0-beta.1' => '7.0.0-beta',
'7.0.0-beta.2' => '7.0.0-beta.1',
'7.0.0-beta.1' => '7.0.0-alpha',
];
$versionSvc = app(VersionService::class);
foreach ($test as $newVersion => $currentVersion) {
$this->assertTrue($versionSvc->isGreaterThan($newVersion, $currentVersion));
}
}
public function testGetLatestVersion(): void
{
setting('general.check_prerelease_version', false);
@@ -27,7 +46,7 @@ class VersionTest extends TestCase
$this->assertEquals('7.0.0-alpha2', $this->kvpRepo->get('latest_version_tag'));
}
public function testGetLatestPrereleaseVersion()
public function testGetLatestPrereleaseVersion(): void
{
$this->updateSetting('general.check_prerelease_version', true);
@@ -40,7 +59,7 @@ class VersionTest extends TestCase
$this->assertEquals('7.0.0-beta', $this->kvpRepo->get('latest_version_tag'));
}
public function testNewVersionNotAvailable()
public function testNewVersionNotAvailable(): void
{
$this->updateSetting('general.check_prerelease_version', false);
@@ -59,7 +78,10 @@ class VersionTest extends TestCase
}
}
public function testNewVersionIsAvailable()
/**
* Version in the prerelease releases.json is v7.0.0-beta
*/
public function testNewVersionIsAvailable(): void
{
$this->updateSetting('general.check_prerelease_version', true);