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

Switch to using MySQL for tests, resolve FK constraint issues

This commit is contained in:
Samuel Štancl 2020-06-07 10:28:55 +02:00
parent 616c5983a4
commit 6735d0a589
4 changed files with 24 additions and 8 deletions

View file

@ -62,7 +62,7 @@ class TenantModelTest extends TestCase
$this->assertSame(null, $tenant->data);
// Low level test to assert database structure
$this->assertSame(json_encode(['foo' => 'bar']), DB::table('tenants')->where('id', $tenant->id)->first()->data);
$this->assertSame(['foo' => 'bar'], json_decode(DB::table('tenants')->where('id', $tenant->id)->first()->data, true));
$this->assertSame(null, DB::table('tenants')->where('id', $tenant->id)->first()->foo ?? null);
// Model has the correct structure when retrieved
@ -105,6 +105,7 @@ class TenantModelTest extends TestCase
/** @test */
public function autoincrement_ids_are_supported()
{
Schema::drop('domains');
Schema::table('tenants', function (Blueprint $table) {
$table->bigIncrements('id')->change();
});