Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jaspertey committed Nov 17, 2024
1 parent e8165d7 commit c55e2ca
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tests/Autoload/CommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
});
Expand All @@ -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);
Expand Down
15 changes: 15 additions & 0 deletions tests/Autoload/ProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
});
});
Expand All @@ -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 () {
Expand All @@ -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);
Expand All @@ -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);
});
Expand All @@ -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);
Expand Down

0 comments on commit c55e2ca

Please sign in to comment.