diff --git a/module/VuFind/config/module.config.php b/module/VuFind/config/module.config.php index a161bb26b1f4f66aa4c6f0eeae88968888a2de80..1f7a48b44e631dffa7965f7ad6ac3dd32094eb34 100644 --- a/module/VuFind/config/module.config.php +++ b/module/VuFind/config/module.config.php @@ -290,6 +290,7 @@ $config = [ 'VuFind\ChannelProvider\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', 'VuFind\Config\AccountCapabilities' => 'VuFind\Config\AccountCapabilitiesFactory', 'VuFind\Config\PluginManager' => 'VuFind\Config\PluginManagerFactory', + 'VuFind\Config\SearchSpecsReader' => 'VuFind\Config\YamlReaderFactory', 'VuFind\Config\YamlReader' => 'VuFind\Config\YamlReaderFactory', 'VuFind\Content\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', 'VuFind\Content\AuthorNotes\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', @@ -337,7 +338,6 @@ $config = [ 'VuFind\Search\Results\PluginManager' => 'VuFind\ServiceManager\AbstractPluginManagerFactory', 'VuFind\Search\Solr\HierarchicalFacetHelper' => 'Zend\ServiceManager\Factory\InvokableFactory', 'VuFind\Search\SearchRunner' => 'VuFind\Search\SearchRunnerFactory', - 'VuFind\SearchSpecsReader' => 'VuFind\Service\Factory::getSearchSpecsReader', 'VuFind\SearchTabsHelper' => 'VuFind\Service\Factory::getSearchTabsHelper', 'VuFind\Service\ReCaptcha' => 'VuFind\Service\ReCaptchaFactory', 'VuFind\Session\Settings' => 'Zend\ServiceManager\Factory\InvokableFactory', @@ -409,6 +409,7 @@ $config = [ 'VuFind\SearchParamsPluginManager' => 'VuFind\Search\Params\PluginManager', 'VuFind\SearchResultsPluginManager' => 'VuFind\Search\Results\PluginManager', 'VuFind\SearchRunner' => 'VuFind\Search\SearchRunner', + 'VuFind\SearchSpecsReader' => 'VuFind\Config\SearchSpecsReader', 'VuFind\YamlReader' => 'VuFind\Config\YamlReader', ], ], diff --git a/module/VuFind/src/VuFind/Search/Factory/AbstractSolrBackendFactory.php b/module/VuFind/src/VuFind/Search/Factory/AbstractSolrBackendFactory.php index e505a67ddc16db8b15c53a268d594fb0a27532c9..cfd22c3835ad9eccd4e2a9f66bb2d1537452f963 100644 --- a/module/VuFind/src/VuFind/Search/Factory/AbstractSolrBackendFactory.php +++ b/module/VuFind/src/VuFind/Search/Factory/AbstractSolrBackendFactory.php @@ -399,7 +399,7 @@ abstract class AbstractSolrBackendFactory implements FactoryInterface */ protected function loadSpecs() { - return $this->serviceLocator->get('VuFind\SearchSpecsReader') + return $this->serviceLocator->get('VuFind\Config\SearchSpecsReader') ->get($this->searchYaml); } diff --git a/module/VuFind/src/VuFind/Service/Factory.php b/module/VuFind/src/VuFind/Service/Factory.php index c8903c701deedd7a620df76628e60f6c49611de6..d7e2e345c0b8630fccc53feff6dab6735f1b5813 100644 --- a/module/VuFind/src/VuFind/Service/Factory.php +++ b/module/VuFind/src/VuFind/Service/Factory.php @@ -130,20 +130,6 @@ class Factory ); } - /** - * Construct the search specs reader. - * - * @param ServiceManager $sm Service manager. - * - * @return \VuFind\Config\SearchSpecsReader - */ - public static function getSearchSpecsReader(ServiceManager $sm) - { - return new \VuFind\Config\SearchSpecsReader( - $sm->get('VuFind\Cache\Manager') - ); - } - /** * Construct the SearchTabs helper. * diff --git a/module/VuFind/src/VuFindTest/Unit/TestCase.php b/module/VuFind/src/VuFindTest/Unit/TestCase.php index 1099e3cce19f4f6160fcf25e179e08f2a78b1fd4..439dac727b706cd081fb3eb405814b03873e8044 100644 --- a/module/VuFind/src/VuFindTest/Unit/TestCase.php +++ b/module/VuFind/src/VuFindTest/Unit/TestCase.php @@ -182,7 +182,8 @@ abstract class TestCase extends \PHPUnit_Framework_TestCase 'VuFind\RecordDriver\PluginManager', $recordDriverFactory ); $this->serviceManager->setService( - 'VuFind\SearchSpecsReader', new \VuFind\Config\SearchSpecsReader() + 'VuFind\Config\SearchSpecsReader', + new \VuFind\Config\SearchSpecsReader() ); $this->serviceManager->setService( 'VuFind\Log\Logger', $this->createMock('VuFind\Log\Logger') diff --git a/module/VuFind/tests/unit-tests/src/VuFindTest/Config/SearchSpecsReaderTest.php b/module/VuFind/tests/unit-tests/src/VuFindTest/Config/SearchSpecsReaderTest.php index a4b5162fc3bca5309675f2769194a762e14751a7..3f9bf92c819d5ebf73717d31cae754bdb60f6357 100644 --- a/module/VuFind/tests/unit-tests/src/VuFindTest/Config/SearchSpecsReaderTest.php +++ b/module/VuFind/tests/unit-tests/src/VuFindTest/Config/SearchSpecsReaderTest.php @@ -94,7 +94,7 @@ class SearchSpecsReaderTest extends \VuFindTest\Unit\TestCase { // The searchspecs.yaml file should define author dismax fields (among many // other things). - $reader = $this->getServiceManager()->get('VuFind\SearchSpecsReader'); + $reader = $this->getServiceManager()->get('VuFind\Config\SearchSpecsReader'); $specs = $reader->get('searchspecs.yaml'); $this->assertTrue( isset($specs['Author']['DismaxFields']) @@ -109,7 +109,7 @@ class SearchSpecsReaderTest extends \VuFindTest\Unit\TestCase */ public function testMissingFileRead() { - $reader = $this->getServiceManager()->get('VuFind\SearchSpecsReader'); + $reader = $this->getServiceManager()->get('VuFind\Config\SearchSpecsReader'); $specs = $reader->get('notreallyasearchspecs.yaml'); $this->assertEquals([], $specs); }