-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
83f89bf
commit 7e39417
Showing
4 changed files
with
72 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
use App\Commands\Command; | ||
|
||
beforeEach(function () { | ||
$this->client->shouldReceive('servers')->andReturn([ | ||
(object) ['id' => 1, 'name' => 'production', 'ipAddress' => '123.456.789.000'], | ||
]); | ||
}); | ||
|
||
afterEach(function () { | ||
Command::resolveLatestVersionUsing(null); | ||
}); | ||
|
||
it('warns the user about the latest unstable versions', function () { | ||
config()->set('app.version', '0.2.1'); | ||
|
||
Command::resolveLatestVersionUsing(function () { | ||
return 'v0.2.2'; | ||
}); | ||
|
||
$this->artisan('server:list') | ||
->expectsOutput('==> You Are Using An Outdated Version [v0.2.1] Of Forge CLI. Please Update To [v0.2.2].'); | ||
}); | ||
|
||
it('warns the user about the latest stable versions', function () { | ||
config()->set('app.version', '0.2.1'); | ||
|
||
Command::resolveLatestVersionUsing(function () { | ||
return 'v1.0.0'; | ||
}); | ||
|
||
$this->artisan('server:list') | ||
->expectsOutput('==> You Are Using An Outdated Version [v0.2.1] Of Forge CLI. Please Update To [v1.0.0].'); | ||
}); | ||
|
||
it('do not warns the user if the version is already up-to-date', function () { | ||
config()->set('app.version', '1.0.1'); | ||
|
||
Command::resolveLatestVersionUsing(function () { | ||
return 'v1.0.1'; | ||
}); | ||
|
||
$this->artisan('server:list') | ||
->doesntExpectOutput('==> You Are Using An Outdated Version [v1.0.1] Of Forge CLI. Please Update To [v1.0.1].'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters