diff --git a/src/ModulesServiceProvider.php b/src/ModulesServiceProvider.php index a93690d60..766fd93c7 100644 --- a/src/ModulesServiceProvider.php +++ b/src/ModulesServiceProvider.php @@ -2,8 +2,6 @@ namespace Nwidart\Modules; -use Illuminate\Filesystem\Filesystem; -use Illuminate\Foundation\ProviderRepository; use Illuminate\Support\ServiceProvider; use Illuminate\Support\Str; use Nwidart\Modules\Providers\ConsoleServiceProvider; @@ -26,15 +24,7 @@ public function register() {} */ protected function registerModules() { - // $this->app->register(\Nwidart\Modules\Providers\BootstrapServiceProvider::class); - - $manifest = app()->make(ModuleManifest::class); - - (new ProviderRepository($this->app, new Filesystem, $this->getCachedModulePath())) - ->load($manifest->providersArray()); - - $manifest->registerFiles(); - + $this->app->register(\Nwidart\Modules\Providers\BootstrapServiceProvider::class); } /** diff --git a/tests/Commands/Actions/ClearCompiledCommandTest.php b/tests/Commands/Actions/ClearCompiledCommandTest.php deleted file mode 100644 index 1f141cd2a..000000000 --- a/tests/Commands/Actions/ClearCompiledCommandTest.php +++ /dev/null @@ -1,82 +0,0 @@ -finder = $this->app['files']; - $this->manifestPath = app()->make(ModuleManifest::class)->manifestPath; - $this->repository = $this->app[RepositoryInterface::class]; - } - - public function tearDown(): void - { - $this->artisan('module:delete', ['--all' => true, '--force' => true]); - parent::tearDown(); - } - - public function test_manifest_file_clear_when_call_command() - { - $this->createModule(); - $code = $this->artisan('module:clear-compiled'); - - $this->assertFileDoesNotExist($this->manifestPath); - $this->assertSame(0, $code); - } - - public function test_manifest_file_clear_when_create_module() - { - $this->assertFileExists($this->manifestPath); - - $this->createModule('Foo'); - - $this->assertFileDoesNotExist($this->manifestPath); - } - - public function test_manifest_file_clear_when_delete_module() - { - $this->assertFileExists($this->manifestPath); - - $this->createModule('Foo'); - - $this->artisan('module:delete', ['module' => 'Foo', '--force' => true]); - - $this->assertFileDoesNotExist($this->manifestPath); - } - - public function test_manifest_file_clear_when_disable_module() - { - $this->assertFileExists($this->manifestPath); - - $this->createModule('Foo'); - - $this->artisan('module:disable', ['module' => 'Foo']); - - $this->assertFileDoesNotExist($this->manifestPath); - } - - public function test_manifest_file_clear_when_enable_module() - { - $this->assertFileExists($this->manifestPath); - - $this->createModule('Foo'); - - $this->artisan('module:enable', ['module' => 'Foo']); - - $this->assertFileDoesNotExist($this->manifestPath); - } -}