From 8bf673098b26be6c5b19fc334a362c2661444822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuel=20=C5=A0tancl?= Date: Sun, 28 Jun 2020 18:24:41 +0200 Subject: [PATCH] Fix guzzle issue --- src/Tenancy.php | 5 ++++- tests/TenantDatabaseManagerTest.php | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/Tenancy.php b/src/Tenancy.php index 687dbd6b..03df9767 100644 --- a/src/Tenancy.php +++ b/src/Tenancy.php @@ -93,13 +93,16 @@ class Tenancy */ 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 $tenants = is_int($tenants) ? (string) $tenants : $tenants; // Wrap string in array $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(); $originalTenant = $this->tenant; diff --git a/tests/TenantDatabaseManagerTest.php b/tests/TenantDatabaseManagerTest.php index f3f99335..cce09598 100644 --- a/tests/TenantDatabaseManagerTest.php +++ b/tests/TenantDatabaseManagerTest.php @@ -213,4 +213,10 @@ class TenantDatabaseManagerTest extends TestCase $manager->setConnection('mysql2'); $this->assertTrue($manager->databaseExists($name)); } + + /** @test */ + public function path_used_by_sqlite_manager_can_be_customized() + { + + } }