From c55e2ca992c1ff8aae9eb81c1ddccb27bdd83240 Mon Sep 17 00:00:00 2001 From: Jasper Tey Date: Sun, 17 Nov 2024 01:07:52 -0500 Subject: [PATCH] wip --- tests/Autoload/CommandTest.php | 9 +++++++++ tests/Autoload/ProviderTest.php | 15 +++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/tests/Autoload/CommandTest.php b/tests/Autoload/CommandTest.php index 13de9ab..a03ff7c 100644 --- a/tests/Autoload/CommandTest.php +++ b/tests/Autoload/CommandTest.php @@ -56,6 +56,9 @@ Path::normalize(base_path('src/Infrastructure')), ]); + collect($mock->getAllLayerPaths()) + ->each(fn ($path) => expect(is_dir($path))->toBeTrue("{$path} is not a directory")); + $expected = array_values($this->commands); $registered = array_values($mock->getRegisteredCommands()); expect($mock->discoverCommands())->toEqualCanonicalizing($expected); @@ -79,6 +82,9 @@ Path::normalize(base_path('src/Infrastructure')), ]); + collect($mock->getAllLayerPaths()) + ->each(fn ($path) => expect(is_dir($path))->toBeTrue("{$path} is not a directory")); + $registered = array_values($mock->getRegisteredCommands()); expect($registered)->toHaveCount(0); }); @@ -98,6 +104,9 @@ Path::normalize(base_path('src/Infrastructure')), ]); + collect($mock->getAllLayerPaths()) + ->each(fn ($path) => expect(is_dir($path))->toBeTrue("{$path} is not a directory")); + $expected = array_values($this->commands); $registered = array_values($mock->getRegisteredCommands()); expect($mock->discoverCommands())->toEqualCanonicalizing($expected); diff --git a/tests/Autoload/ProviderTest.php b/tests/Autoload/ProviderTest.php index a193e7c..c59dbdd 100644 --- a/tests/Autoload/ProviderTest.php +++ b/tests/Autoload/ProviderTest.php @@ -52,6 +52,9 @@ Path::normalize(base_path('src/Infrastructure')), ]); + collect($mock->getAllLayerPaths()) + ->each(fn ($path) => expect(is_dir($path))->toBeTrue("{$path} is not a directory")); + expect($mock->getRegisteredProviders())->toBeEmpty(); }); }); @@ -69,6 +72,9 @@ Path::normalize(base_path('src/Application')), Path::normalize(base_path('src/Infrastructure')), ]); + + collect($mock->getAllLayerPaths()) + ->each(fn ($path) => expect(is_dir($path))->toBeTrue("{$path} is not a directory")); }); it('registers the providers', function () { @@ -83,6 +89,9 @@ Path::normalize(base_path('src/Infrastructure')), ]); + collect($mock->getAllLayerPaths()) + ->each(fn ($path) => expect(is_dir($path))->toBeTrue("{$path} is not a directory")); + $expected = array_values($this->providers); $registered = array_values($mock->getRegisteredProviders()); expect($mock->discoverProviders())->toEqualCanonicalizing($expected); @@ -106,6 +115,9 @@ Path::normalize(base_path('src/Infrastructure')), ]); + collect($mock->getAllLayerPaths()) + ->each(fn ($path) => expect(is_dir($path))->toBeTrue("{$path} is not a directory")); + $registered = array_values($mock->getRegisteredProviders()); expect($registered)->toHaveCount(0); }); @@ -125,6 +137,9 @@ Path::normalize(base_path('src/Infrastructure')), ]); + collect($mock->getAllLayerPaths()) + ->each(fn ($path) => expect(is_dir($path))->toBeTrue("{$path} is not a directory")); + $expected = array_values($this->providers); $registered = array_values($mock->getRegisteredProviders()); expect($mock->discoverProviders())->toEqualCanonicalizing($expected);