From 06ea90f6384506a5b786a32dbd4bb959f62e8452 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Tue, 17 Mar 2026 10:21:29 +0000 Subject: [PATCH] test: Add tests for DumpCommand handle method Co-authored-by: juzaweb <47020363+juzaweb@users.noreply.github.com> --- tests/Unit/DumpCommandTest.php | 38 ++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/Unit/DumpCommandTest.php diff --git a/tests/Unit/DumpCommandTest.php b/tests/Unit/DumpCommandTest.php new file mode 100644 index 0000000..eeb1dec --- /dev/null +++ b/tests/Unit/DumpCommandTest.php @@ -0,0 +1,38 @@ +makePartial(); + $command->shouldReceive('dump')->with('Blog')->once(); + + $this->app[\Illuminate\Contracts\Console\Kernel::class]->registerCommand($command); + + $this->artisan('module:dump', ['module' => 'Blog']) + ->assertExitCode(0); + } + + public function test_it_dumps_all_modules() + { + $command = Mockery::mock(DumpCommand::class . '[dumpAll]')->makePartial(); + $command->shouldReceive('dumpAll')->once(); + + $this->app[\Illuminate\Contracts\Console\Kernel::class]->registerCommand($command); + + $this->artisan('module:dump') + ->assertExitCode(0); + } +}