@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function getNamespace(): ?string |
64 | 64 | { |
65 | - return $this->getStub()->getOptions()["NAMESPACE"] ?? null; |
|
65 | + return $this->getStub()->getOptions()[ "NAMESPACE" ] ?? null; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function getClassName(): ?string |
72 | 72 | { |
73 | - return $this->getStub()->getOptions()["CLASS"] ?? null; |
|
73 | + return $this->getStub()->getOptions()[ "CLASS" ] ?? null; |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function getModule(): string |
80 | 80 | { |
81 | - return $this->getStub()->getOptions()["MODULE"]; |
|
81 | + return $this->getStub()->getOptions()[ "MODULE" ]; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $pipeline = $this->generator->getPipeline(); |
54 | 54 | |
55 | 55 | $this->assertIsArray($pipeline); |
56 | - $this->assertEquals('Controller', $pipeline[0]['name']); |
|
56 | + $this->assertEquals('Controller', $pipeline[ 0 ][ 'name' ]); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | public function testModuleGeneration() |
@@ -62,9 +62,9 @@ discard block |
||
62 | 62 | |
63 | 63 | $this->generator->addController($controller = 'AController'); |
64 | 64 | |
65 | - $this->generator->addTest($serviceTest = 'AServiceTest', $serviceType ='service'); |
|
66 | - $this->generator->addTest($httpTest = 'AHttpTest', $httpType ='http'); |
|
67 | - $this->generator->addTest($unitTest = 'AUnitTest', $unitType ='unit'); |
|
65 | + $this->generator->addTest($serviceTest = 'AServiceTest', $serviceType = 'service'); |
|
66 | + $this->generator->addTest($httpTest = 'AHttpTest', $httpType = 'http'); |
|
67 | + $this->generator->addTest($unitTest = 'AUnitTest', $unitType = 'unit'); |
|
68 | 68 | |
69 | 69 | $this->generator->addCommand($command = 'ACommand', $commandName = 'command:dosomething'); |
70 | 70 |
@@ -47,7 +47,7 @@ |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | protected function getModuleGenerator(string $moduleName) :GeneratorManager{ |
50 | - return GeneratorManager::module($moduleName,true); |
|
50 | + return GeneratorManager::module($moduleName,true); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | public function testCreateSqlMigration() |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | } |
48 | 48 | |
49 | 49 | protected function getModuleGenerator(string $moduleName) :GeneratorManager{ |
50 | - return GeneratorManager::module($moduleName,true); |
|
50 | + return GeneratorManager::module($moduleName, true); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | public function testCreateSqlMigration() |
@@ -84,9 +84,9 @@ discard block |
||
84 | 84 | public function testCreateFactory() |
85 | 85 | { |
86 | 86 | $moduleName = "User"; |
87 | - $this->getModuleGenerator($moduleName)->createFactory( "User"); |
|
87 | + $this->getModuleGenerator($moduleName)->createFactory("User"); |
|
88 | 88 | |
89 | - $expectedFileName = Larapi::getModule($moduleName)->getFactories()->getPath() . '/UserFactory.php'; |
|
89 | + $expectedFileName = Larapi::getModule($moduleName)->getFactories()->getPath().'/UserFactory.php'; |
|
90 | 90 | $expectedStubName = "factory.stub"; |
91 | 91 | $expectedStubOptions = [ |
92 | 92 | 'CLASS' => 'UserFactory', |
@@ -106,9 +106,9 @@ discard block |
||
106 | 106 | public function testCreateController() |
107 | 107 | { |
108 | 108 | $moduleName = "User"; |
109 | - $this->getModuleGenerator($moduleName)->createController( "UserController"); |
|
109 | + $this->getModuleGenerator($moduleName)->createController("UserController"); |
|
110 | 110 | |
111 | - $expectedFileName = Larapi::getModule($moduleName)->getControllers()->getPath() . '/UserController.php'; |
|
111 | + $expectedFileName = Larapi::getModule($moduleName)->getControllers()->getPath().'/UserController.php'; |
|
112 | 112 | $expectedStubName = "controller.stub"; |
113 | 113 | $expectedStubOptions = [ |
114 | 114 | 'CLASS' => 'UserController', |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $moduleName = "User"; |
130 | 130 | $this->getModuleGenerator($moduleName)->createListener("SendWelcomeMail", "UserRegisteredEvent"); |
131 | 131 | |
132 | - $expectedFileName = Larapi::getModule($moduleName)->getListeners()->getPath() . '/SendWelcomeMail.php'; |
|
132 | + $expectedFileName = Larapi::getModule($moduleName)->getListeners()->getPath().'/SendWelcomeMail.php'; |
|
133 | 133 | $expectedStubName = "listener.stub"; |
134 | 134 | $expectedStubOptions = [ |
135 | 135 | 'CLASS' => 'SendWelcomeMail', |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | $fileName = "RandomUserJob"; |
164 | 164 | $this->getModuleGenerator($moduleName)->createJob($fileName, false); |
165 | 165 | |
166 | - $expectedFileName = Larapi::getModule($moduleName)->getJobs()->getPath() . "/$fileName.php"; |
|
166 | + $expectedFileName = Larapi::getModule($moduleName)->getJobs()->getPath()."/$fileName.php"; |
|
167 | 167 | $expectedStubName = "job-queued.stub"; |
168 | 168 | $expectedStubOptions = [ |
169 | 169 | 'NAMESPACE' => 'Modules\User\Jobs', |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | public function testCreateSynchronousJob() |
183 | 183 | { |
184 | 184 | $moduleName = "User"; |
185 | - $this->getModuleGenerator($moduleName)->createJob( "AJob", true); |
|
185 | + $this->getModuleGenerator($moduleName)->createJob("AJob", true); |
|
186 | 186 | $event = $this->getFirstDispatchedEvent(JobGeneratedEvent::class); |
187 | 187 | |
188 | 188 | $this->assertNotNull($event); |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | |
198 | 198 | $this->getModuleGenerator($moduleName)->createCommand($fileName, $commandName); |
199 | 199 | |
200 | - $expectedFileName = Larapi::getModule($moduleName)->getCommands()->getPath() . "/$fileName.php"; |
|
200 | + $expectedFileName = Larapi::getModule($moduleName)->getCommands()->getPath()."/$fileName.php"; |
|
201 | 201 | $expectedStubName = "command.stub"; |
202 | 202 | $expectedStubOptions = [ |
203 | 203 | 'NAMESPACE' => 'Modules\User\Console', |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | $this->assertEquals($expectedStubName, $event->getStub()->getName()); |
215 | 215 | $this->assertEquals($expectedStubOptions, $event->getStub()->getOptions()); |
216 | 216 | |
217 | - $this->assertEquals($commandName,$event->getConsoleCommand()); |
|
217 | + $this->assertEquals($commandName, $event->getConsoleCommand()); |
|
218 | 218 | //$this->assertEquals($expectedStubOptions, $event->getStub()->getOptions()); |
219 | 219 | } |
220 | 220 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | |
226 | 226 | $this->getModuleGenerator($moduleName)->createMiddleware($fileName); |
227 | 227 | |
228 | - $expectedFileName = Larapi::getModule($moduleName)->getMiddleWare()->getPath() . "/$fileName.php"; |
|
228 | + $expectedFileName = Larapi::getModule($moduleName)->getMiddleWare()->getPath()."/$fileName.php"; |
|
229 | 229 | $expectedStubName = "middleware.stub"; |
230 | 230 | $expectedStubOptions = [ |
231 | 231 | 'CLASS' => 'RandomMiddleware', |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | |
249 | 249 | $this->getModuleGenerator($moduleName)->createServiceProvider($fileName); |
250 | 250 | |
251 | - $expectedFileName = Larapi::getModule($moduleName)->getServiceProviders()->getPath() . "/$fileName.php"; |
|
251 | + $expectedFileName = Larapi::getModule($moduleName)->getServiceProviders()->getPath()."/$fileName.php"; |
|
252 | 252 | $expectedStubName = "provider.stub"; |
253 | 253 | $expectedStubOptions = [ |
254 | 254 | 'NAMESPACE' => 'Modules\User\Providers', |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | |
272 | 272 | $this->getModuleGenerator($moduleName)->createNotification($fileName); |
273 | 273 | |
274 | - $expectedFileName = Larapi::getModule($moduleName)->getNotifications()->getPath() . "/$fileName.php"; |
|
274 | + $expectedFileName = Larapi::getModule($moduleName)->getNotifications()->getPath()."/$fileName.php"; |
|
275 | 275 | $expectedStubName = "notification.stub"; |
276 | 276 | $expectedStubOptions = [ |
277 | 277 | 'NAMESPACE' => 'Modules\User\Notifications', |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | |
295 | 295 | $this->getModuleGenerator($moduleName)->createModel($fileName, false, true); |
296 | 296 | |
297 | - $expectedFileName = Larapi::getModule($moduleName)->getModels()->getPath() . "/$moduleName$fileName.php"; |
|
297 | + $expectedFileName = Larapi::getModule($moduleName)->getModels()->getPath()."/$moduleName$fileName.php"; |
|
298 | 298 | $expectedStubName = "model.stub"; |
299 | 299 | $expectedStubOptions = [ |
300 | 300 | 'NAMESPACE' => 'Modules\User\Entities', |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | |
330 | 330 | $this->getModuleGenerator($moduleName)->createPolicy($fileName); |
331 | 331 | |
332 | - $expectedFileName = Larapi::getModule($moduleName)->getPolicies()->getPath() . "/$fileName.php"; |
|
332 | + $expectedFileName = Larapi::getModule($moduleName)->getPolicies()->getPath()."/$fileName.php"; |
|
333 | 333 | $expectedStubName = "policy.stub"; |
334 | 334 | $expectedStubOptions = [ |
335 | 335 | 'NAMESPACE' => 'Modules\User\Policies', |
@@ -352,7 +352,7 @@ discard block |
||
352 | 352 | |
353 | 353 | $this->getModuleGenerator($moduleName)->createTransformer($fileName, $model); |
354 | 354 | |
355 | - $expectedFileName = Larapi::getModule($moduleName)->getTransformers()->getPath() . "/$fileName.php"; |
|
355 | + $expectedFileName = Larapi::getModule($moduleName)->getTransformers()->getPath()."/$fileName.php"; |
|
356 | 356 | $expectedStubName = "transformer.stub"; |
357 | 357 | $expectedStubOptions = [ |
358 | 358 | 'NAMESPACE' => 'Modules\User\Transformers', |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | |
377 | 377 | $this->getModuleGenerator($moduleName)->createTest($fileName, 'unit'); |
378 | 378 | |
379 | - $expectedFileName = Larapi::getModule($moduleName)->getTests()->getPath() . "/$fileName.php"; |
|
379 | + $expectedFileName = Larapi::getModule($moduleName)->getTests()->getPath()."/$fileName.php"; |
|
380 | 380 | $expectedStubName = "unit-test.stub"; |
381 | 381 | $expectedStubOptions = [ |
382 | 382 | 'NAMESPACE' => 'Modules\User\Tests', |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | |
400 | 400 | $this->getModuleGenerator($moduleName)->createRequest($fileName); |
401 | 401 | |
402 | - $expectedFileName = Larapi::getModule($moduleName)->getRequests()->getPath() . "/$fileName.php"; |
|
402 | + $expectedFileName = Larapi::getModule($moduleName)->getRequests()->getPath()."/$fileName.php"; |
|
403 | 403 | $expectedStubName = "request.stub"; |
404 | 404 | $expectedStubOptions = [ |
405 | 405 | 'NAMESPACE' => 'Modules\User\Http\Requests', |
@@ -421,7 +421,7 @@ discard block |
||
421 | 421 | |
422 | 422 | $this->getModuleGenerator($moduleName)->createRule($fileName); |
423 | 423 | |
424 | - $expectedFileName = Larapi::getModule($moduleName)->getRules()->getPath() . "/$fileName.php"; |
|
424 | + $expectedFileName = Larapi::getModule($moduleName)->getRules()->getPath()."/$fileName.php"; |
|
425 | 425 | $expectedStubName = "rule.stub"; |
426 | 426 | $expectedStubOptions = [ |
427 | 427 | 'NAMESPACE' => 'Modules\User\Rules', |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | |
444 | 444 | $this->getModuleGenerator($moduleName)->createSeeder($fileName); |
445 | 445 | |
446 | - $expectedFileName = Larapi::getModule($moduleName)->getSeeders()->getPath() . "/$fileName.php"; |
|
446 | + $expectedFileName = Larapi::getModule($moduleName)->getSeeders()->getPath()."/$fileName.php"; |
|
447 | 447 | $expectedStubName = "seeder.stub"; |
448 | 448 | $expectedStubOptions = [ |
449 | 449 | 'NAMESPACE' => 'Modules\User\Database\Seeders', |
@@ -461,11 +461,11 @@ discard block |
||
461 | 461 | public function testCreateRoute() |
462 | 462 | { |
463 | 463 | $moduleName = "Demo"; |
464 | - $routename = strtolower(Str::plural($moduleName)) . '.v1'; |
|
464 | + $routename = strtolower(Str::plural($moduleName)).'.v1'; |
|
465 | 465 | |
466 | 466 | $this->getModuleGenerator($moduleName)->createRoute(); |
467 | 467 | |
468 | - $expectedFileName = Larapi::getModule($moduleName)->getRoutes()->getPath() . "/$routename.php"; |
|
468 | + $expectedFileName = Larapi::getModule($moduleName)->getRoutes()->getPath()."/$routename.php"; |
|
469 | 469 | $expectedStubName = "route.stub"; |
470 | 470 | $expectedStubOptions = [ |
471 | 471 | 'MODULE_NAME' => 'Demo', |
@@ -487,7 +487,7 @@ discard block |
||
487 | 487 | |
488 | 488 | $this->getModuleGenerator($moduleName)->createComposer(); |
489 | 489 | |
490 | - $expectedFileName = Larapi::getModule($moduleName)->getPath() . "/composer.json"; |
|
490 | + $expectedFileName = Larapi::getModule($moduleName)->getPath()."/composer.json"; |
|
491 | 491 | $expectedStubName = "composer.stub"; |
492 | 492 | $expectedStubOptions = [ |
493 | 493 | 'LOWER_MODULE_NAME' => 'demo', |