1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2025-12-12 12:54:05 +00:00

Add command tests

This commit is contained in:
Samuel Štancl 2019-02-09 11:53:48 +01:00
parent 33fcb8a936
commit e1def355f9
13 changed files with 98 additions and 15 deletions

View file

@ -0,0 +1,20 @@
<?php
namespace Stancl\Tenancy\Tests;
class DatabaseManagerTest extends TestCase
{
public $autoInitTenancy = false;
/** @test */
public function disconnect_method_works()
{
$old_connection_name = app(\Illuminate\Database\DatabaseManager::class)->connection()->getName();
tenancy()->init();
tenancy()->disconnectDatabase();
$new_connection_name = app(\Illuminate\Database\DatabaseManager::class)->connection()->getName();
$this->assertSame($old_connection_name, $new_connection_name);
$this->assertNotEquals('tenant', $new_connection_name);
}
}