Fix BindingResolutionError when debug toolbar isn't present (#465)

* Fix BindingResolutionError when debug toolbar isn't present

* Formatting
This commit is contained in:
Nabeel S
2019-12-11 15:12:31 -05:00
committed by GitHub
parent e6d38f9338
commit a58bca390b
8 changed files with 67 additions and 21 deletions

View File

@@ -20,17 +20,24 @@ class VersionTest extends TestCase
public function testGreaterThanVersionStrings(): void
{
$test = [
'7.0.0' => '6.0.0',
'7.0.0+1231s' => '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.2+a34sdf' => '7.0.0-beta.1',
['7.0.0' => '6.0.0'],
['7.0.0+1231s' => '6.0.0'],
// ['7.0.0-beta' => '7.0.0-dev'],
['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.2+a34sdf' => '7.0.0-beta.1'],
];
$versionSvc = app(VersionService::class);
foreach ($test as $newVersion => $currentVersion) {
$this->assertTrue($versionSvc->isGreaterThan($newVersion, $currentVersion));
foreach ($test as $set) {
$newVersion = array_key_first($set);
$currentVersion = $set[$newVersion];
$this->assertTrue(
$versionSvc->isGreaterThan($newVersion, $currentVersion),
"{$newVersion} not greater than ${currentVersion}"
);
}
}