Add support for unit testing
This commit is contained in:
parent
c0839464fd
commit
9f17c7add0
|
|
@ -66,13 +66,23 @@ class PluginManager
|
|||
*/
|
||||
protected function init()
|
||||
{
|
||||
$this->app = App::make('app');
|
||||
$this->bindSoftDependencies();
|
||||
$this->metaFile = storage_path() . '/cms/disabled.json';
|
||||
$this->loadDisabled();
|
||||
$this->loadPlugins();
|
||||
$this->loadDependencies();
|
||||
}
|
||||
|
||||
/**
|
||||
* These objects are "soft singletons" and may be lost when
|
||||
* the IoC container reboots. This provides a way to rebuild
|
||||
* for the purposes of unit testing.
|
||||
*/
|
||||
public function bindSoftDependencies()
|
||||
{
|
||||
$this->app = App::make('app');
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds all available plugins and loads them in to the $plugins array.
|
||||
* @return array
|
||||
|
|
|
|||
|
|
@ -75,11 +75,10 @@ class UpdateManager
|
|||
{
|
||||
$this->pluginManager = PluginManager::instance();
|
||||
$this->versionManager = VersionManager::instance();
|
||||
$this->migrator = App::make('migrator');
|
||||
$this->repository = App::make('migration.repository');
|
||||
$this->tempDirectory = temp_path();
|
||||
$this->baseDirectory = base_path();
|
||||
$this->disableCoreUpdates = Config::get('cms.disableCoreUpdates', false);
|
||||
$this->bindSoftDependencies();
|
||||
|
||||
/*
|
||||
* Ensure temp directory exists
|
||||
|
|
@ -89,6 +88,12 @@ class UpdateManager
|
|||
}
|
||||
}
|
||||
|
||||
public function bindSoftDependencies()
|
||||
{
|
||||
$this->migrator = App::make('migrator');
|
||||
$this->repository = App::make('migration.repository');
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the migration table and updates
|
||||
* @return self
|
||||
|
|
|
|||
Loading…
Reference in New Issue