diff --git a/.env.example b/.env.example index de83758..6eec97b 100644 --- a/.env.example +++ b/.env.example @@ -17,7 +17,7 @@ SESSION_DRIVER=file QUEUE_DRIVER=sync CACHE_DRIVER=file -CACHE_REPOSITORY=true +CACHE_REPOSITORY=false CACHE_REPOSITORY_LIFETIME=-1 REDIS_HOST=127.0.0.1 diff --git a/tests/CmsInstallTest.php b/tests/CmsInstallTest.php index 8e42d8e..a820e9e 100644 --- a/tests/CmsInstallTest.php +++ b/tests/CmsInstallTest.php @@ -1,5 +1,8 @@ roleRepository = app(\WebEd\Base\ACL\Repositories\Contracts\RoleRepositoryContract::class); $this->userRepository = app(\WebEd\Base\Users\Repositories\Contracts\UserRepositoryContract::class); + $this->coreModuleRepository = app(CoreModulesRepositoryContract::class); } /** @@ -65,15 +74,31 @@ protected function createAdminUser() protected function registerInstallModuleService() { - $modules = get_modules_by_type('base'); + $modules = get_core_module(); + + $core = $modules->where('alias', '=', 'webed-core')->first(); + + $coreNamespace = str_replace('\\\\', '\\', array_get($core, 'namespace', '') . '\Providers\InstallModuleServiceProvider'); + + $this->app->register($coreNamespace); + + $data = [ + 'alias' => 'webed-core', + 'installed_version' => get_cms_version(), + ]; + $this->coreModuleRepository->create($data); + + $modules = get_core_module()->where('namespace', '!=', 'WebEd\Base'); + foreach ($modules as $module) { $namespace = str_replace('\\\\', '\\', array_get($module, 'namespace', '') . '\Providers\InstallModuleServiceProvider'); if (class_exists($namespace)) { $this->app->register($namespace); } } - \Artisan::call('vendor:publish', [ + /*\Artisan::call('vendor:publish', [ '--tag' => 'webed-public-assets', - ]); + '--force' => true, + ]);*/ } }