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

Get tests to run

This commit is contained in:
Samuel Štancl 2019-09-11 21:11:40 +02:00
parent 23a4fd24b0
commit 7a0154bf8e
8 changed files with 46 additions and 29 deletions

View file

@ -5,13 +5,14 @@ declare(strict_types=1);
namespace Stancl\Tenancy\TenancyBoostrappers;
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
use Stancl\Tenancy\Tenant;
class CacheTenancyBoostrapper implements TenancyBootstrapper
{
/** @var \Illuminate\Cache\CacheManager */
protected $originalCache;
public function start()
public function start(Tenant $tenant)
{
$this->originalCache = $this->originalCache ?? $this->app['cache'];
$this->app->extend('cache', function () {

View file

@ -7,6 +7,7 @@ namespace Stancl\Tenancy\TenancyBoostrappers;
use Illuminate\Foundation\Application;
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
use Stancl\Tenancy\DatabaseManager;
use Stancl\Tenancy\Tenant;
class DatabaseTenancyBootstrapper implements TenancyBootstrapper
{

View file

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Stancl\Tenancy\TenancyBoostrappers;
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
use Stancl\Tenancy\Tenant;
// todo better solution than tenant_asset?
@ -24,7 +25,7 @@ class FilesystemTenancyBootstrapper implements TenancyBootstrapper
];
}
public function start()
public function start(Tenant $tenant)
{
// todo revisit this
$suffix = $this->app['config']['tenancy.filesystem.suffix_base'] . tenant('uuid');

View file

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Stancl\Tenancy\TenancyBoostrappers;
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
use Stancl\Tenancy\Tenant;
class QueueTenancyBootstrapper implements TenancyBootstrapper
{
@ -26,7 +27,7 @@ class QueueTenancyBootstrapper implements TenancyBootstrapper
});
}
public function start()
public function start(Tenant $tenant)
{
$this->started = true;
}

View file

@ -5,6 +5,7 @@ declare(strict_types=1);
namespace Stancl\Tenancy\TenantDatabaseManagers;
use Stancl\Tenancy\Contracts\TenancyBootstrapper;
use Stancl\Tenancy\Tenant;
class RedisTenancyBootstrapper implements TenancyBootstrapper
{
@ -19,7 +20,7 @@ class RedisTenancyBootstrapper implements TenancyBootstrapper
$this->app = $app;
}
public function start()
public function start(Tenant $tenant)
{
foreach ($this->prefixedConnections() as $connection) {
$prefix = $this->app['config']['tenancy.redis.prefix_base'] . $this->tenant['uuid'];