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

Apply fixes from StyleCI (#80)

This commit is contained in:
Samuel Štancl 2019-08-02 20:01:10 +02:00 committed by GitHub
parent bd6583b6af
commit eceacd9422
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 83 additions and 70 deletions

View file

@ -2,11 +2,11 @@
namespace Stancl\Tenancy\Tests;
use Illuminate\Support\Facades\Redis;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Redis;
use Illuminate\Support\Facades\Storage;
class DataSeparationTest extends TestCase
{
@ -19,7 +19,7 @@ class DataSeparationTest extends TestCase
$tenant1 = tenancy()->create('tenant1.localhost');
$tenant2 = tenancy()->create('tenant2.localhost');
\Artisan::call('tenants:migrate', [
'--tenants' => [$tenant1['uuid'], $tenant2['uuid']]
'--tenants' => [$tenant1['uuid'], $tenant2['uuid']],
]);
tenancy()->init('tenant1.localhost');
@ -31,7 +31,7 @@ class DataSeparationTest extends TestCase
'remember_token' => Str::random(10),
]);
$this->assertSame('foo', User::first()->name);
tenancy()->init('tenant2.localhost');
$this->assertSame(null, User::first());
@ -52,7 +52,7 @@ class DataSeparationTest extends TestCase
$tenant3 = tenancy()->create('tenant3.localhost');
\Artisan::call('tenants:migrate', [
'--tenants' => [$tenant1['uuid'], $tenant3['uuid']]
'--tenants' => [$tenant1['uuid'], $tenant3['uuid']],
]);
tenancy()->init('tenant3.localhost');
@ -72,7 +72,7 @@ class DataSeparationTest extends TestCase
tenancy()->init('tenant1.localhost');
Redis::set('foo', 'bar');
$this->assertSame('bar', Redis::get('foo'));
tenancy()->init('tenant2.localhost');
$this->assertSame(null, Redis::get('foo'));
Redis::set('foo', 'xyz');
@ -99,7 +99,7 @@ class DataSeparationTest extends TestCase
tenancy()->init('tenant1.localhost');
Cache::put('foo', 'bar', 60);
$this->assertSame('bar', Cache::get('foo'));
tenancy()->init('tenant2.localhost');
$this->assertSame(null, Cache::get('foo'));
Cache::put('foo', 'xyz', 60);
@ -126,7 +126,7 @@ class DataSeparationTest extends TestCase
tenancy()->init('tenant1.localhost');
Storage::disk('public')->put('foo', 'bar');
$this->assertSame('bar', Storage::disk('public')->get('foo'));
tenancy()->init('tenant2.localhost');
$this->assertFalse(Storage::disk('public')->exists('foo'));
Storage::disk('public')->put('foo', 'xyz');
@ -148,4 +148,4 @@ class DataSeparationTest extends TestCase
class User extends \Illuminate\Database\Eloquent\Model
{
protected $guarded = [];
}
}