mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 14:34:04 +00:00
Get multiple envs (redis/db) to run correctly
This commit is contained in:
parent
9c9858e97e
commit
8565cc7acc
19 changed files with 31 additions and 35 deletions
|
|
@ -6,7 +6,7 @@ namespace Stancl\Tenancy\Tests;
|
|||
|
||||
use Illuminate\Support\Facades\Redis;
|
||||
|
||||
// todo rename
|
||||
// todo2 rename
|
||||
class BootstrapsTenancyTest extends TestCase
|
||||
{
|
||||
public $autoInitTenancy = false;
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ class CommandsTest extends TestCase
|
|||
->expectsOutput('xyz');
|
||||
}
|
||||
|
||||
// todo check that multiple tenants can be migrated at once using all database engines
|
||||
// todo2 check that multiple tenants can be migrated at once using all database engines
|
||||
|
||||
/** @test */
|
||||
public function install_command_works()
|
||||
|
|
@ -129,7 +129,7 @@ class CommandsTest extends TestCase
|
|||
\mkdir($dir, 0777, true);
|
||||
}
|
||||
|
||||
// todo move this to a file
|
||||
// todo2 move this to a file
|
||||
\file_put_contents(app_path('Http/Kernel.php'), "<?php
|
||||
|
||||
namespace App\Http;
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@ class QueueTest extends TestCase
|
|||
/** @test */
|
||||
public function queues_use_non_tenant_db_connection()
|
||||
{
|
||||
// todo finish this test. requires using the db driver
|
||||
// todo2 finish this test. requires using the db driver
|
||||
$this->markTestIncomplete();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,14 +15,14 @@ class TenantAssetTest extends TestCase
|
|||
|
||||
// response()->file() returns BinaryFileResponse whose content is
|
||||
// inaccessible via getContent, so ->assertSee() can't be used
|
||||
// $this->get(tenant_asset($filename))->assertSuccessful(); // TODO COMMENTED ASSERTIONS
|
||||
// $this->assertFileExists($path); // TODO COMMENTED ASSERTIONS
|
||||
// $this->get(tenant_asset($filename))->assertSuccessful(); // TODO2 COMMENTED ASSERTIONS
|
||||
// $this->assertFileExists($path); // TODO2 COMMENTED ASSERTIONS
|
||||
|
||||
$f = \fopen($path, 'r');
|
||||
$content = \fread($f, \filesize($path));
|
||||
\fclose($f);
|
||||
|
||||
// $this->assertSame('bar', $content); // TODO COMMENTED ASSERTIONS
|
||||
$this->assertTrue(true); // TODO COMMENTED ASSERTIONS
|
||||
// $this->assertSame('bar', $content); // TODO2 COMMENTED ASSERTIONS
|
||||
$this->assertTrue(true); // TODO2 COMMENTED ASSERTIONS
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,8 +14,6 @@ use Stancl\Tenancy\TenantDatabaseManagers\SQLiteDatabaseManager;
|
|||
|
||||
class TenantDatabaseManagerTest extends TestCase
|
||||
{
|
||||
// todo use data providers and TenantDatabaseManager::databaseExists()
|
||||
|
||||
/**
|
||||
* @test
|
||||
* @dataProvider database_manager_provider
|
||||
|
|
|
|||
|
|
@ -205,6 +205,6 @@ class TenantManagerTest extends TestCase
|
|||
/** @test */
|
||||
public function id_cannot_be_changed()
|
||||
{
|
||||
// todo
|
||||
// todo1
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,14 +105,10 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
|
|||
$app['config']->set([
|
||||
'tenancy.storage_driver' => RedisStorageDriver::class,
|
||||
]);
|
||||
|
||||
// tenancy()->storage = $app->make(RedisStorageDriver::class); // TODO this shouldn't be necessary but is necessary
|
||||
} elseif (env('TENANCY_TEST_STORAGE_DRIVER', 'redis') === 'db') {
|
||||
$app['config']->set([
|
||||
'tenancy.storage_driver' => DatabaseStorageDriver::class,
|
||||
]);
|
||||
|
||||
// tenancy()->storage = $app->make(DatabaseStorageDriver::class); // TODO this shouldn't be necessary but is necessary
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue