From 07ae531a099917be93ec8312842bf19ad24f6b19 Mon Sep 17 00:00:00 2001 From: Ron Northrip Date: Thu, 14 Mar 2024 19:19:25 -0400 Subject: [PATCH] Add test for empty dbs --- tests/ExampleTest.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/ExampleTest.php b/tests/ExampleTest.php index 7b1ca21..ff85705 100644 --- a/tests/ExampleTest.php +++ b/tests/ExampleTest.php @@ -3,10 +3,17 @@ use Illuminate\Support\Str; use RonNorthrip\DBPull\Commands\DBPull; -it('can figure out the mysql tables key', function () { +it('can figure out the mysql tables key for empty db', function () { + // $dbname = 'Tables_in_'.Str::snake(config('database.connections.testing.database')); $dbpull = new DBPull(); $method = new ReflectionMethod(DBPull::class, 'local_tables_key'); $result = $method->invoke($dbpull); - $dbname = 'Tables_in_'.Str::snake(config('database.connections.testing.database')); - expect($result)->toBe($dbname); + expect($result)->toBe(null); +}); + +it('can figure out the mysql tables list for empty db', function () { + $dbpull = new DBPull(); + $method = new ReflectionMethod(DBPull::class, 'local_get_tables'); + $result = $method->invoke($dbpull); + expect($result)->toBe([]); });