Mercurial > packages > magicforger
diff src/Generator/Generator.php @ 37:116b36f5e73b ls_dev_2025_09
Adding support for tests. It's pretty basic but we can improve later.
| author | Luka Sitas <sitas.luka.97@gmail.com> |
|---|---|
| date | Thu, 25 Sep 2025 19:58:01 -0400 |
| parents | 76584181267a |
| children | c062f013fd19 |
line wrap: on
line diff
--- a/src/Generator/Generator.php Sat Sep 20 17:14:29 2025 -0400 +++ b/src/Generator/Generator.php Thu Sep 25 19:58:01 2025 -0400 @@ -82,6 +82,10 @@ if ($this->option('route')) { $this->createRoute(); } + + if ($this->option('test')) { + $this->createTest(); + } } /** @@ -96,7 +100,8 @@ ['request', 'r', InputOption::VALUE_NONE, 'Generate base request classes for the table.'], ['view', '', InputOption::VALUE_NONE, 'Generate base views for the table.'], ['route', 'w', InputOption::VALUE_NONE, 'Generate base routes classes for the table.'], - ['factory', 'f', InputOption::VALUE_NONE, 'Generate base factory classes for the table.'], + ['factory', 'F', InputOption::VALUE_NONE, 'Generate base factory classes for the table.'], + ['test', 't', InputOption::VALUE_NONE, 'Generate base test classes for the table.'], ]); } @@ -136,4 +141,9 @@ { $this->call('mf:factory', ['table' => $this->getTableInput(), '--fresh' => $this->option('fresh')]); } + + protected function createTest() + { + $this->call('mf:test', ['table' => $this->getTableInput(), '--fresh' => $this->option('fresh')]); + } }
