remove unreachable code

This commit is contained in:
Pig Fang 2020-01-05 11:24:30 +08:00
parent 9608555345
commit 3c8f820780
3 changed files with 1 additions and 28 deletions

View File

@ -16,15 +16,6 @@ use Vectorface\Whip\Whip;
class SetupController extends Controller
{
public function welcome(Filesystem $filesystem)
{
if (!$filesystem->exists(base_path('.env'))) {
$filesystem->copy(base_path('.env.example'), base_path('.env'));
}
return view('setup.wizard.welcome');
}
public function database(
Request $request,
Filesystem $filesystem,

View File

@ -174,7 +174,7 @@ Route::group(['middleware' => ['authorize', 'admin'], 'prefix' => 'admin'], func
*/
Route::group(['prefix' => 'setup'], function () {
Route::group(['middleware' => 'setup'], function () {
Route::any('/', 'SetupController@welcome');
Route::view('/', 'setup.wizard.welcome');
Route::any('/database', 'SetupController@database');
Route::view('/info', 'setup.wizard.info');
Route::post('/finish', 'SetupController@finish');

View File

@ -17,24 +17,6 @@ class SetupControllerTest extends TestCase
$this->spy(\App\Services\Webpack::class);
}
public function testWelcome()
{
$this->mock(Filesystem::class, function ($mock) {
$mock->shouldReceive('exists')
->with(storage_path('install.lock'))
->andReturn(false);
$mock->shouldReceive('exists')
->with(base_path('.env'))
->once()
->andReturn(false);
$mock->shouldReceive('copy')
->with(base_path('.env.example'), base_path('.env'))
->once()
->andReturn(true);
});
$this->get('/setup')->assertViewIs('setup.wizard.welcome');
}
public function testDatabase()
{
$this->mock(Filesystem::class, function ($mock) {