Skip to content
Snippets Groups Projects
Commit f1d3a8df authored by Demian Katz's avatar Demian Katz Committed by Robert Lange
Browse files

Eliminate hard-coded class strings.

parent f3206523
No related merge requests found
......@@ -145,56 +145,57 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase
$this->serviceManager,
[
'abstract_factories' =>
['VuFind\Search\Options\PluginFactory'],
[\VuFind\Search\Options\PluginFactory::class],
]
);
$this->serviceManager->setService(
'VuFind\Search\Options\PluginManager', $optionsFactory
\VuFind\Search\Options\PluginManager::class, $optionsFactory
);
$paramsFactory = new \VuFind\Search\Params\PluginManager(
$this->serviceManager,
[
'abstract_factories' =>
['VuFind\Search\Params\PluginFactory'],
[\VuFind\Search\Params\PluginFactory::class],
]
);
$this->serviceManager->setService(
'VuFind\Search\Params\PluginManager', $paramsFactory
\VuFind\Search\Params\PluginManager::class, $paramsFactory
);
$resultsFactory = new \VuFind\Search\Results\PluginManager(
$this->serviceManager,
[
'abstract_factories' =>
['VuFind\Search\Results\PluginFactory'],
[\VuFind\Search\Results\PluginFactory::class],
]
);
$this->serviceManager->setService(
'VuFind\Search\Results\PluginManager', $resultsFactory
\VuFind\Search\Results\PluginManager::class, $resultsFactory
);
$recordDriverFactory = new \VuFind\RecordDriver\PluginManager(
$this->serviceManager,
[
'abstract_factories' =>
['VuFind\RecordDriver\PluginFactory']
[\VuFind\RecordDriver\PluginFactory::class]
]
);
$this->serviceManager->setService(
'VuFind\RecordDriver\PluginManager', $recordDriverFactory
\VuFind\RecordDriver\PluginManager::class, $recordDriverFactory
);
$this->serviceManager->setService(
'VuFind\Config\SearchSpecsReader',
\VuFind\Config\SearchSpecsReader::class,
new \VuFind\Config\SearchSpecsReader()
);
$this->serviceManager->setService(
'VuFind\Log\Logger', $this->createMock(\VuFind\Log\Logger::class)
\VuFind\Log\Logger::class,
$this->createMock(\VuFind\Log\Logger::class)
);
$this->serviceManager->setService(
'VuFindHttp\HttpService', new \VuFindHttp\HttpService()
\VuFindHttp\HttpService::class, new \VuFindHttp\HttpService()
);
$this->setupSearchService();
$cfg = ['abstract_factories' => ['VuFind\Config\PluginFactory']];
$cfg = ['abstract_factories' => [\VuFind\Config\PluginFactory::class]];
$this->serviceManager->setService(
'VuFind\Config\PluginManager',
\VuFind\Config\PluginManager::class,
new \VuFind\Config\PluginManager($this->serviceManager, $cfg)
);
$this->serviceManager->setService(
......@@ -203,7 +204,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase
$driverManager = $this->serviceManager
->get(\VuFind\RecordDriver\PluginManager::class);
$this->serviceManager->setService(
'VuFind\Record\Loader', new \VuFind\Record\Loader(
\VuFind\Record\Loader::class, new \VuFind\Record\Loader(
$this->serviceManager->get(\VuFindSearch\Service::class),
$driverManager
)
......@@ -211,7 +212,7 @@ abstract class TestCase extends \PHPUnit\Framework\TestCase
$this->serviceManager->setService('Config', []);
$factory = new \Zend\Mvc\I18n\TranslatorFactory();
$this->serviceManager->setService(
'Zend\Mvc\I18n\Translator',
\Zend\Mvc\I18n\Translator::class,
$factory->createService($this->serviceManager)
);
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment