Mercurial > packages > magicforger
diff src/Replacer/Replacer.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 | 55d2e5c5dad9 |
| children |
line wrap: on
line diff
--- a/src/Replacer/Replacer.php Sat Sep 20 17:14:29 2025 -0400 +++ b/src/Replacer/Replacer.php Thu Sep 25 19:58:01 2025 -0400 @@ -165,6 +165,14 @@ return Str::singular(Str::studly($name)) . 'Factory'; } + /** + * Generate test name in Studly case. + */ + public function test_name(string $name): string + { + return Str::singular(Str::studly($name)) . 'Test'; + } + // Namespace Methods // These methods handle the formation of various namespaces used within the replacements. @@ -285,6 +293,16 @@ } /** + * Get the test namespace. + */ + public function getTestNamespace(string $name = ''): string + { + return base_path() + . DIRECTORY_SEPARATOR . 'tests' + . DIRECTORY_SEPARATOR . 'CRUD' ; + } + + /** * Get the request uses string for replacement. */ public function getRequestUses(string $name): string
