fix: check tables if it's existed when db is connected
This commit is contained in:
parent
f7b5046a38
commit
6d93a78d22
|
|
@ -245,7 +245,11 @@ class SetupController extends Controller
|
|||
{
|
||||
if (request()->is('setup') || request()->is('setup/database')) {
|
||||
// We're ready to install Blessing Skin, so skip the checks.
|
||||
return false;
|
||||
try {
|
||||
DB::connection(env('DB_CONNECTION'))->getPdo();
|
||||
} catch (\Exception $e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
$existingTables = [];
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Tests;
|
||||
|
||||
use DB;
|
||||
use App\Models\User;
|
||||
use App\Services\Facades\Option;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
|
@ -119,6 +120,13 @@ class MiddlewareTest extends TestCase
|
|||
'setup.wizard.welcome.text',
|
||||
['version' => config('app.version')]
|
||||
));
|
||||
|
||||
DB::shouldReceive('connection')->once()->andThrow(new \Exception('fake exception'));
|
||||
DB::shouldReceive('disconnect')->andReturnSelf();
|
||||
$this->get('/setup')->assertSee(trans(
|
||||
'setup.wizard.welcome.text',
|
||||
['version' => config('app.version')]
|
||||
));
|
||||
}
|
||||
|
||||
public function testCheckPlayerExist()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user