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

Fix guzzle issue

This commit is contained in:
Samuel Štancl 2020-06-28 18:24:41 +02:00
parent 34d3189d61
commit 8bf673098b
2 changed files with 10 additions and 1 deletions

View file

@ -93,13 +93,16 @@ class Tenancy
*/ */
public function runForMultiple($tenants, callable $callback) public function runForMultiple($tenants, callable $callback)
{ {
// Convert null to all tenants
$tenants = is_null($tenants) ? $this->model()->cursor() : $tenants;
// Convert incrementing int ids to strings // Convert incrementing int ids to strings
$tenants = is_int($tenants) ? (string) $tenants : $tenants; $tenants = is_int($tenants) ? (string) $tenants : $tenants;
// Wrap string in array // Wrap string in array
$tenants = is_string($tenants) ? [$tenants] : $tenants; $tenants = is_string($tenants) ? [$tenants] : $tenants;
// Use all tenants if $tenants is falsy // Use all tenants if $tenants is falsey
$tenants = $tenants ?: $this->model()->cursor(); $tenants = $tenants ?: $this->model()->cursor();
$originalTenant = $this->tenant; $originalTenant = $this->tenant;

View file

@ -213,4 +213,10 @@ class TenantDatabaseManagerTest extends TestCase
$manager->setConnection('mysql2'); $manager->setConnection('mysql2');
$this->assertTrue($manager->databaseExists($name)); $this->assertTrue($manager->databaseExists($name));
} }
/** @test */
public function path_used_by_sqlite_manager_can_be_customized()
{
}
} }