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

Add more tests, fix bugs

This commit is contained in:
Samuel Štancl 2019-02-08 17:54:53 +01:00
parent d14aa0b642
commit 3f650d887d
4 changed files with 65 additions and 8 deletions

View file

@ -5,6 +5,7 @@ namespace Stancl\Tenancy;
use Illuminate\Support\Facades\Redis;
use Stancl\Tenancy\Interfaces\StorageDriver;
use Stancl\Tenancy\Traits\BootstrapsTenancy;
use Illuminate\Contracts\Foundation\Application;
class TenantManager
{
@ -13,7 +14,7 @@ class TenantManager
/**
* The application instance.
*
* @var \Illuminate\Contracts\Foundation\Application|\Illuminate\Foundation\Application
* @var Application
*/
private $app;
@ -38,7 +39,7 @@ class TenantManager
*/
public $tenant;
public function __construct($app, StorageDriver $storage, DatabaseManager $database)
public function __construct(Application $app, StorageDriver $storage, DatabaseManager $database)
{
$this->app = $app;
$this->storage = $storage;
@ -190,7 +191,7 @@ class TenantManager
public function actAsId(string $uuid): array
{
$this->setTenant($this->storage->getTenantById($uuid));
$this->bootstrap(); // todo this could break storage_path() for example?
$this->bootstrap();
return $this->tenant;
}