1717 // Create a temporary providers.php file for testing
1818 $ filesystem = new Filesystem ;
1919 $ bootstrapPath = $ this ->app ->bootstrapPath ();
20-
20+
2121 // Ensure bootstrap directory exists
22- if (!$ filesystem ->exists ($ bootstrapPath )) {
22+ if (! $ filesystem ->exists ($ bootstrapPath )) {
2323 $ filesystem ->makeDirectory ($ bootstrapPath , 0755 , true );
2424 }
2525
2626 // Create providers.php with initial content
27- $ filesystem ->put ($ bootstrapPath . '/providers.php ' , $ initialProvidersContent );
27+ $ filesystem ->put ($ bootstrapPath. '/providers.php ' , $ initialProvidersContent );
2828});
2929
3030afterEach (function () use ($ initialProvidersContent ) {
3131 // Restore the providers.php file to its initial state
3232 $ filesystem = new Filesystem ;
3333 $ bootstrapPath = $ this ->app ->bootstrapPath ();
34- $ filesystem ->put ($ bootstrapPath . '/providers.php ' , $ initialProvidersContent );
34+ $ filesystem ->put ($ bootstrapPath. '/providers.php ' , $ initialProvidersContent );
3535});
3636
3737/**
@@ -50,8 +50,8 @@ function getPackageProviders($app)
5050 ->assertSuccessful ()
5151 ->expectsOutput ('Service provider for module Blog registered successfully. ' );
5252
53- $ content = file_get_contents ($ this ->app ->bootstrapPath () . '/providers.php ' );
54-
53+ $ content = file_get_contents ($ this ->app ->bootstrapPath (). '/providers.php ' );
54+
5555 // Check that the new provider was added
5656 expect ($ content )
5757 ->toContain ('Modules\Blog\BlogServiceProvider::class ' );
@@ -68,16 +68,16 @@ function getPackageProviders($app)
6868 ->expectsOutput ('Service provider for module Blog is already registered. ' );
6969
7070 // Verify the provider appears only once
71- $ content = file_get_contents ($ this ->app ->bootstrapPath () . '/providers.php ' );
71+ $ content = file_get_contents ($ this ->app ->bootstrapPath (). '/providers.php ' );
7272 expect (substr_count ($ content , 'Modules\Blog\BlogServiceProvider::class ' ))->toBe (1 );
7373});
7474
7575test ('it maintains existing providers and formatting when adding new provider ' , function () {
7676 $ this ->artisan ('modular:register-provider ' , ['name ' => 'Blog ' ])
7777 ->assertSuccessful ();
7878
79- $ content = file_get_contents ($ this ->app ->bootstrapPath () . '/providers.php ' );
80-
79+ $ content = file_get_contents ($ this ->app ->bootstrapPath (). '/providers.php ' );
80+
8181 // Verify the structure is maintained
8282 expect ($ content )
8383 ->toContain ('<?php ' )
@@ -95,9 +95,9 @@ function getPackageProviders($app)
9595 ->assertSuccessful ();
9696 $ this ->artisan ('modular:register-provider ' , ['name ' => 'Shop ' ])
9797 ->assertSuccessful ();
98-
99- $ content = file_get_contents ($ this ->app ->bootstrapPath () . '/providers.php ' );
100-
98+
99+ $ content = file_get_contents ($ this ->app ->bootstrapPath (). '/providers.php ' );
100+
101101 // Verify both new providers were added while maintaining existing ones
102102 expect ($ content )
103103 ->toContain ('Modules\Blog\BlogServiceProvider::class ' )
@@ -112,7 +112,7 @@ function getPackageProviders($app)
112112
113113test ('registerServiceProvider method returns correct boolean ' , function () {
114114 $ command = $ this ->app ->make (RegisterServiceProviderCommand::class);
115-
115+
116116 expect ($ command ->registerServiceProvider ('NewModule ' ))->toBeTrue ()
117117 ->and ($ command ->registerServiceProvider ('NewModule ' ))->toBeFalse ();
118- });
118+ });
0 commit comments