mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-13 04:04:04 +00:00
Add command tests
This commit is contained in:
parent
33fcb8a936
commit
e1def355f9
13 changed files with 98 additions and 15 deletions
|
|
@ -9,8 +9,11 @@ use Illuminate\Database\DatabaseManager as BaseDatabaseManager;
|
|||
|
||||
class DatabaseManager
|
||||
{
|
||||
public $originalDefaultConnection;
|
||||
|
||||
public function __construct(BaseDatabaseManager $database)
|
||||
{
|
||||
$this->originalDefaultConnection = config('database.default');
|
||||
$this->database = $database;
|
||||
}
|
||||
|
||||
|
|
@ -28,8 +31,9 @@ class DatabaseManager
|
|||
|
||||
public function disconnect()
|
||||
{
|
||||
$this->database->reconnect('default');
|
||||
$this->database->setDefaultConnection('default');
|
||||
$default_connection = $this->originalDefaultConnection;
|
||||
$this->database->reconnect($default_connection);
|
||||
$this->database->setDefaultConnection($default_connection);
|
||||
}
|
||||
|
||||
public function create(string $name, string $driver = null)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue