File tree Expand file tree Collapse file tree
tests/system/Commands/Generators Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -134,6 +134,33 @@ public function testGenerateModelWithOptionSuffix(): void
134134 rmdir (dirname ($ entity ));
135135 }
136136
137+ public function testGenerateModelWithSubNamespaceAndReturnEntity (): void
138+ {
139+ command ('make:model admin/class --return entity ' );
140+
141+ $ model = APPPATH . 'Models/Admin/Class.php ' ;
142+ $ entity = APPPATH . 'Entities/Admin/Class.php ' ;
143+
144+ $ this ->assertFileExists ($ model );
145+ $ this ->assertFileExists ($ entity );
146+
147+ if (is_file ($ model )) {
148+ unlink ($ model );
149+ }
150+ $ modelDir = dirname ($ model );
151+ if (is_dir ($ modelDir )) {
152+ rmdir ($ modelDir );
153+ }
154+
155+ if (is_file ($ entity )) {
156+ unlink ($ entity );
157+ }
158+ $ entityDir = dirname ($ entity );
159+ if (is_dir ($ entityDir )) {
160+ rmdir ($ entityDir );
161+ }
162+ }
163+
137164 /**
138165 * @see https://github.com/codeigniter4/CodeIgniter4/issues/5050
139166 */
You can’t perform that action at this time.
0 commit comments