diff --git a/Client.php b/Client.php index fe700ad..b1a9cc5 100644 --- a/Client.php +++ b/Client.php @@ -1,9 +1,9 @@ diff --git a/Command/PopulateCommand.php b/Command/PopulateCommand.php index 440333e..0310060 100755 --- a/Command/PopulateCommand.php +++ b/Command/PopulateCommand.php @@ -1,6 +1,6 @@ setName('foq:elastica:populate') + ->setName('fos:elastica:populate') ->addOption('index', null, InputOption::VALUE_OPTIONAL, 'The index to repopulate') ->addOption('type', null, InputOption::VALUE_OPTIONAL, 'The type to repopulate') ->addOption('no-reset', null, InputOption::VALUE_NONE, 'Do not reset index before populating') @@ -48,9 +48,9 @@ class PopulateCommand extends ContainerAwareCommand */ protected function initialize(InputInterface $input, OutputInterface $output) { - $this->indexManager = $this->getContainer()->get('foq_elastica.index_manager'); - $this->providerRegistry = $this->getContainer()->get('foq_elastica.provider_registry'); - $this->resetter = $this->getContainer()->get('foq_elastica.resetter'); + $this->indexManager = $this->getContainer()->get('fos_elastica.index_manager'); + $this->providerRegistry = $this->getContainer()->get('fos_elastica.provider_registry'); + $this->resetter = $this->getContainer()->get('fos_elastica.resetter'); } /** diff --git a/Command/SearchCommand.php b/Command/SearchCommand.php index 30712ce..1a878b0 100644 --- a/Command/SearchCommand.php +++ b/Command/SearchCommand.php @@ -1,6 +1,6 @@ setName('foq:elastica:search') + ->setName('fos:elastica:search') ->addArgument('type', InputArgument::REQUIRED, 'The type to search in') ->addArgument('query', InputArgument::REQUIRED, 'The text to search') ->addOption('index', null, InputOption::VALUE_REQUIRED, 'The index to search in') @@ -41,7 +41,7 @@ class SearchCommand extends ContainerAwareCommand protected function execute(InputInterface $input, OutputInterface $output) { $indexName = $input->getOption('index'); - $index = $this->getContainer()->get('foq_elastica.index_manager')->getIndex($indexName ? $indexName : null); + $index = $this->getContainer()->get('fos_elastica.index_manager')->getIndex($indexName ? $indexName : null); $type = $index->getType($input->getArgument('type')); $query = Elastica_Query::create($input->getArgument('query')); $query->setLimit($input->getOption('limit')); diff --git a/Configuration/Search.php b/Configuration/Search.php index d3cb624..ded65a5 100644 --- a/Configuration/Search.php +++ b/Configuration/Search.php @@ -1,6 +1,6 @@ hasDefinition('foq_elastica.provider_registry')) { + if (!$container->hasDefinition('fos_elastica.provider_registry')) { return; } // Infer the default index name from the service alias - $defaultIndex = substr($container->getAlias('foq_elastica.index'), 19); + $defaultIndex = substr($container->getAlias('fos_elastica.index'), 19); - $registry = $container->getDefinition('foq_elastica.provider_registry'); - $providers = $container->findTaggedServiceIds('foq_elastica.provider'); + $registry = $container->getDefinition('fos_elastica.provider_registry'); + $providers = $container->findTaggedServiceIds('fos_elastica.provider'); foreach ($providers as $providerId => $tags) { $index = $type = null; @@ -62,7 +62,7 @@ class RegisterProvidersPass implements CompilerPassInterface { if (!isset($this->implementations[$class])) { $refl = new \ReflectionClass($class); - $this->implementations[$class] = $refl->implementsInterface('FOQ\ElasticaBundle\Provider\ProviderInterface'); + $this->implementations[$class] = $refl->implementsInterface('FOS\ElasticaBundle\Provider\ProviderInterface'); } return $this->implementations[$class]; diff --git a/DependencyInjection/Compiler/TransformerPass.php b/DependencyInjection/Compiler/TransformerPass.php index ea7bc85..2c260c9 100644 --- a/DependencyInjection/Compiler/TransformerPass.php +++ b/DependencyInjection/Compiler/TransformerPass.php @@ -1,6 +1,6 @@ hasDefinition('foq_elastica.elastica_to_model_transformer.collection.prototype')) { + if (!$container->hasDefinition('fos_elastica.elastica_to_model_transformer.collection.prototype')) { return; } $transformers = array(); - foreach ($container->findTaggedServiceIds('foq_elastica.elastica_to_model_transformer') as $id => $tags) { + foreach ($container->findTaggedServiceIds('fos_elastica.elastica_to_model_transformer') as $id => $tags) { foreach ($tags as $tag) { if (empty($tag['index']) || empty($tag['type'])) { throw new InvalidArgumentException('The Transformer must have both a type and an index defined.'); @@ -37,11 +37,11 @@ class TransformerPass implements CompilerPassInterface } foreach ($transformers as $index => $indexTransformers) { - if (!$container->hasDefinition(sprintf('foq_elastica.elastica_to_model_transformer.collection.%s', $index))) { + if (!$container->hasDefinition(sprintf('fos_elastica.elastica_to_model_transformer.collection.%s', $index))) { continue; } - $index = $container->getDefinition(sprintf('foq_elastica.elastica_to_model_transformer.collection.%s', $index)); + $index = $container->getDefinition(sprintf('fos_elastica.elastica_to_model_transformer.collection.%s', $index)); $index->replaceArgument(0, $indexTransformers); } } diff --git a/DependencyInjection/Configuration.php b/DependencyInjection/Configuration.php index 80c400c..df9793b 100644 --- a/DependencyInjection/Configuration.php +++ b/DependencyInjection/Configuration.php @@ -1,6 +1,6 @@ root('foq_elastica', 'array'); + $rootNode = $treeBuilder->root('fos_elastica', 'array'); $this->addClientsSection($rootNode); $this->addIndexesSection($rootNode); diff --git a/DependencyInjection/FOQElasticaExtension.php b/DependencyInjection/FOQElasticaExtension.php index d444510..fda0b51 100644 --- a/DependencyInjection/FOQElasticaExtension.php +++ b/DependencyInjection/FOQElasticaExtension.php @@ -1,6 +1,6 @@ loadIndexManager($indexRefsByName, $container); $this->loadResetter($this->indexConfigs, $container); - $container->setAlias('foq_elastica.client', sprintf('foq_elastica.client.%s', $config['default_client'])); - $container->setAlias('foq_elastica.index', sprintf('foq_elastica.index.%s', $config['default_index'])); + $container->setAlias('fos_elastica.client', sprintf('fos_elastica.client.%s', $config['default_client'])); + $container->setAlias('fos_elastica.index', sprintf('fos_elastica.index.%s', $config['default_index'])); $this->createDefaultManagerAlias($config['default_manager'], $container); } @@ -69,10 +69,10 @@ class FOQElasticaExtension extends Extension { $clientIds = array(); foreach ($clients as $name => $clientConfig) { - $clientDef = $container->getDefinition('foq_elastica.client'); + $clientDef = $container->getDefinition('fos_elastica.client'); $clientDef->replaceArgument(0, $clientConfig); - $clientId = sprintf('foq_elastica.client.%s', $name); + $clientId = sprintf('fos_elastica.client.%s', $name); $container->setDefinition($clientId, $clientDef); @@ -102,10 +102,10 @@ class FOQElasticaExtension extends Extension } $clientId = $clientIdsByName[$clientName]; - $indexId = sprintf('foq_elastica.index.%s', $name); + $indexId = sprintf('fos_elastica.index.%s', $name); $indexName = isset($index['index_name']) ? $index['index_name'] : $name; $indexDefArgs = array($indexName); - $indexDef = new Definition('%foq_elastica.index.class%', $indexDefArgs); + $indexDef = new Definition('%fos_elastica.index.class%', $indexDefArgs); $indexDef->setFactoryService($clientId); $indexDef->setFactoryMethod('getIndex'); $container->setDefinition($indexId, $indexDef); @@ -139,13 +139,13 @@ class FOQElasticaExtension extends Extension */ protected function loadIndexFinder(ContainerBuilder $container, $name, $indexId) { - $abstractTransformerId = 'foq_elastica.elastica_to_model_transformer.collection.prototype'; - $transformerId = sprintf('foq_elastica.elastica_to_model_transformer.collection.%s', $name); + $abstractTransformerId = 'fos_elastica.elastica_to_model_transformer.collection.prototype'; + $transformerId = sprintf('fos_elastica.elastica_to_model_transformer.collection.%s', $name); $transformerDef = new DefinitionDecorator($abstractTransformerId); $container->setDefinition($transformerId, $transformerDef); - $abstractFinderId = 'foq_elastica.finder.prototype'; - $finderId = sprintf('foq_elastica.finder.%s', $name); + $abstractFinderId = 'fos_elastica.finder.prototype'; + $finderId = sprintf('fos_elastica.finder.%s', $name); $finderDef = new DefinitionDecorator($abstractFinderId); $finderDef->replaceArgument(0, new Reference($indexId)); $finderDef->replaceArgument(1, new Reference($transformerId)); @@ -167,7 +167,7 @@ class FOQElasticaExtension extends Extension $type = self::deepArrayUnion($typePrototypeConfig, $type); $typeId = sprintf('%s.%s', $indexId, $name); $typeDefArgs = array($name); - $typeDef = new Definition('%foq_elastica.type.class%', $typeDefArgs); + $typeDef = new Definition('%fos_elastica.type.class%', $typeDefArgs); $typeDef->setFactoryService($indexId); $typeDef->setFactoryMethod('getType'); $container->setDefinition($typeId, $typeDef); @@ -250,10 +250,10 @@ class FOQElasticaExtension extends Extension if (isset($typeConfig['elastica_to_model_transformer']['service'])) { return $typeConfig['elastica_to_model_transformer']['service']; } - $abstractId = sprintf('foq_elastica.elastica_to_model_transformer.prototype.%s', $typeConfig['driver']); - $serviceId = sprintf('foq_elastica.elastica_to_model_transformer.%s.%s', $indexName, $typeName); + $abstractId = sprintf('fos_elastica.elastica_to_model_transformer.prototype.%s', $typeConfig['driver']); + $serviceId = sprintf('fos_elastica.elastica_to_model_transformer.%s.%s', $indexName, $typeName); $serviceDef = new DefinitionDecorator($abstractId); - $serviceDef->addTag('foq_elastica.elastica_to_model_transformer', array('type' => $typeName, 'index' => $indexName)); + $serviceDef->addTag('fos_elastica.elastica_to_model_transformer', array('type' => $typeName, 'index' => $indexName)); // Doctrine has a mandatory service as first argument $argPos = ('propel' === $typeConfig['driver']) ? 0 : 1; @@ -273,8 +273,8 @@ class FOQElasticaExtension extends Extension if (isset($typeConfig['model_to_elastica_transformer']['service'])) { return $typeConfig['model_to_elastica_transformer']['service']; } - $abstractId = sprintf('foq_elastica.model_to_elastica_transformer.prototype.auto'); - $serviceId = sprintf('foq_elastica.model_to_elastica_transformer.%s.%s', $indexName, $typeName); + $abstractId = sprintf('fos_elastica.model_to_elastica_transformer.prototype.auto'); + $serviceId = sprintf('fos_elastica.model_to_elastica_transformer.%s.%s', $indexName, $typeName); $serviceDef = new DefinitionDecorator($abstractId); $serviceDef->replaceArgument(0, array( 'identifier' => $typeConfig['identifier'] @@ -286,8 +286,8 @@ class FOQElasticaExtension extends Extension protected function loadObjectPersister(array $typeConfig, Definition $typeDef, ContainerBuilder $container, $indexName, $typeName, $transformerId) { - $abstractId = sprintf('foq_elastica.object_persister.prototype'); - $serviceId = sprintf('foq_elastica.object_persister.%s.%s', $indexName, $typeName); + $abstractId = sprintf('fos_elastica.object_persister.prototype'); + $serviceId = sprintf('fos_elastica.object_persister.%s.%s', $indexName, $typeName); $serviceDef = new DefinitionDecorator($abstractId); $serviceDef->replaceArgument(0, $typeDef); $serviceDef->replaceArgument(1, new Reference($transformerId)); @@ -304,9 +304,9 @@ class FOQElasticaExtension extends Extension return $typeConfig['provider']['service']; } - $providerId = sprintf('foq_elastica.provider.%s.%s', $indexName, $typeName); - $providerDef = new DefinitionDecorator('foq_elastica.provider.prototype.' . $typeConfig['driver']); - $providerDef->addTag('foq_elastica.provider', array('index' => $indexName, 'type' => $typeName)); + $providerId = sprintf('fos_elastica.provider.%s.%s', $indexName, $typeName); + $providerDef = new DefinitionDecorator('fos_elastica.provider.prototype.' . $typeConfig['driver']); + $providerDef->addTag('fos_elastica.provider', array('index' => $indexName, 'type' => $typeName)); $providerDef->replaceArgument(0, new Reference($objectPersisterId)); $providerDef->replaceArgument(1, $typeConfig['model']); // Propel provider can simply ignore Doctrine-specific options @@ -321,8 +321,8 @@ class FOQElasticaExtension extends Extension if (isset($typeConfig['listener']['service'])) { return $typeConfig['listener']['service']; } - $abstractListenerId = sprintf('foq_elastica.listener.prototype.%s', $typeConfig['driver']); - $listenerId = sprintf('foq_elastica.listener.%s.%s', $indexName, $typeName); + $abstractListenerId = sprintf('fos_elastica.listener.prototype.%s', $typeConfig['driver']); + $listenerId = sprintf('fos_elastica.listener.%s.%s', $indexName, $typeName); $listenerDef = new DefinitionDecorator($abstractListenerId); $listenerDef->replaceArgument(0, new Reference($objectPersisterId)); $listenerDef->replaceArgument(1, $typeConfig['model']); @@ -372,15 +372,15 @@ class FOQElasticaExtension extends Extension if (isset($typeConfig['finder']['service'])) { $finderId = $typeConfig['finder']['service']; } else { - $abstractFinderId = 'foq_elastica.finder.prototype'; - $finderId = sprintf('foq_elastica.finder.%s.%s', $indexName, $typeName); + $abstractFinderId = 'fos_elastica.finder.prototype'; + $finderId = sprintf('fos_elastica.finder.%s.%s', $indexName, $typeName); $finderDef = new DefinitionDecorator($abstractFinderId); $finderDef->replaceArgument(0, $typeDef); $finderDef->replaceArgument(1, new Reference($elasticaToModelId)); $container->setDefinition($finderId, $finderDef); } - $managerId = sprintf('foq_elastica.manager.%s', $typeConfig['driver']); + $managerId = sprintf('fos_elastica.manager.%s', $typeConfig['driver']); $managerDef = $container->getDefinition($managerId); $arguments = array( $typeConfig['model'], new Reference($finderId)); if (isset($typeConfig['repository'])) { @@ -399,9 +399,9 @@ class FOQElasticaExtension extends Extension **/ protected function loadIndexManager(array $indexRefsByName, ContainerBuilder $container) { - $managerDef = $container->getDefinition('foq_elastica.index_manager'); + $managerDef = $container->getDefinition('fos_elastica.index_manager'); $managerDef->replaceArgument(0, $indexRefsByName); - $managerDef->replaceArgument(1, new Reference('foq_elastica.index')); + $managerDef->replaceArgument(1, new Reference('fos_elastica.index')); } /** @@ -411,7 +411,7 @@ class FOQElasticaExtension extends Extension **/ protected function loadResetter(array $indexConfigs, ContainerBuilder $container) { - $resetterDef = $container->getDefinition('foq_elastica.resetter'); + $resetterDef = $container->getDefinition('fos_elastica.resetter'); $resetterDef->replaceArgument(0, $indexConfigs); } @@ -439,7 +439,7 @@ class FOQElasticaExtension extends Extension $defaultManagerService = $this->loadedDrivers[0]; } - $container->setAlias('foq_elastica.manager', sprintf('foq_elastica.manager.%s', $defaultManagerService)); + $container->setAlias('fos_elastica.manager', sprintf('fos_elastica.manager.%s', $defaultManagerService)); } } diff --git a/Doctrine/AbstractElasticaToModelTransformer.php b/Doctrine/AbstractElasticaToModelTransformer.php index 9a74cfa..f8e19db 100755 --- a/Doctrine/AbstractElasticaToModelTransformer.php +++ b/Doctrine/AbstractElasticaToModelTransformer.php @@ -1,10 +1,10 @@ diff --git a/Exception/InvalidArgumentTypeException.php b/Exception/InvalidArgumentTypeException.php index fc319a8..c41823e 100644 --- a/Exception/InvalidArgumentTypeException.php +++ b/Exception/InvalidArgumentTypeException.php @@ -1,6 +1,6 @@ @@ -58,14 +58,14 @@ class RepositoryManager implements RepositoryManagerInterface } $refClass = new \ReflectionClass($entityName); - $annotation = $this->reader->getClassAnnotation($refClass, 'FOQ\\ElasticaBundle\\Configuration\\Search'); + $annotation = $this->reader->getClassAnnotation($refClass, 'FOS\\ElasticaBundle\\Configuration\\Search'); if ($annotation) { $this->entities[$entityName]['repositoryName'] = $annotation->repositoryClass; return $annotation->repositoryClass; } - return 'FOQ\ElasticaBundle\Repository'; + return 'FOS\ElasticaBundle\Repository'; } private function createRepository($entityName) diff --git a/Manager/RepositoryManagerInterface.php b/Manager/RepositoryManagerInterface.php index 9340506..c831d35 100644 --- a/Manager/RepositoryManagerInterface.php +++ b/Manager/RepositoryManagerInterface.php @@ -1,8 +1,8 @@ diff --git a/Paginator/FantaPaginatorAdapter.php b/Paginator/FantaPaginatorAdapter.php index 07aee7d..4307abc 100644 --- a/Paginator/FantaPaginatorAdapter.php +++ b/Paginator/FantaPaginatorAdapter.php @@ -1,9 +1,9 @@ registerNamespaces(array( ... - 'FOQ' => __DIR__.'/../vendor/bundles', + 'FOS' => __DIR__.'/../vendor/bundles', )); #### Register the bundle @@ -86,7 +86,7 @@ $ php bin/vendors install { return array( // ... - new FOQ\ElasticaBundle\FOQElasticaBundle(), + new FOS\ElasticaBundle\FOSElasticaBundle(), // ... ); } @@ -99,7 +99,7 @@ Elasticsearch client is comparable to a database connection. Most of the time, you will need only one. #app/config/config.yml - foq_elastica: + fos_elastica: clients: default: { host: localhost, port: 9200 } @@ -108,7 +108,7 @@ Most of the time, you will need only one. Elasticsearch index is comparable to Doctrine entity manager. Most of the time, you will need only one. - foq_elastica: + fos_elastica: clients: default: { host: localhost, port: 9200 } indexes: @@ -117,14 +117,14 @@ Most of the time, you will need only one. Here we created a "website" index, that uses our "default" client. -Our index is now available as a service: `foq_elastica.index.website`. It is an instance of `Elastica_Index`. +Our index is now available as a service: `fos_elastica.index.website`. It is an instance of `Elastica_Index`. If you need to have different index name from the service name, for example, in order to have different indexes for different environments then you can use the ```index_name``` key to change the index name. The service name will remain the same across the environments: - foq_elastica: + fos_elastica: clients: default: { host: localhost, port: 9200 } indexes: @@ -132,13 +132,13 @@ remain the same across the environments: client: default index_name: website_qa -The service id will be `foq_elastica.index.website` but the underlying index name is website_qa. +The service id will be `fos_elastica.index.website` but the underlying index name is website_qa. #### Declare a type Elasticsearch type is comparable to Doctrine entity repository. - foq_elastica: + fos_elastica: clients: default: { host: localhost, port: 9200 } indexes: @@ -152,11 +152,11 @@ Elasticsearch type is comparable to Doctrine entity repository. lastName: { boost: 3 } aboutMe: ~ -Our type is now available as a service: `foq_elastica.index.website.user`. It is an instance of `Elastica_Type`. +Our type is now available as a service: `fos_elastica.index.website.user`. It is an instance of `Elastica_Type`. ### Declaring parent field - foq_elastica: + fos_elastica: clients: default: { host: localhost, port: 9200 } indexes: @@ -171,7 +171,7 @@ Our type is now available as a service: `foq_elastica.index.website.user`. It is ### Declaring `nested` or `object` - foq_elastica: + fos_elastica: clients: default: { host: localhost, port: 9200 } indexes: @@ -191,7 +191,7 @@ Our type is now available as a service: `foq_elastica.index.website.user`. It is ### Populate the types - php app/console foq:elastica:populate + php app/console fos:elastica:populate This command deletes and creates the declared indexes and types. It applies the configured mappings to the types. @@ -206,7 +206,7 @@ Or, for complete flexibility, go for manual provider. If we want to index the entities from a Doctrine repository or a Propel query, some configuration will let ElasticaBundle do it for us. - foq_elastica: + fos_elastica: clients: default: { host: localhost, port: 9200 } indexes: @@ -262,21 +262,21 @@ You can change this value in the persistence configuration. #### Manual provider -Create a service with the tag "foq_elastica.provider" and attributes for the +Create a service with the tag "fos_elastica.provider" and attributes for the index and type for which the service will provide. - - + + -Its class must implement `FOQ\ElasticaBundle\Provider\ProviderInterface`. +Its class must implement `FOS\ElasticaBundle\Provider\ProviderInterface`. container->get('foq_elastica.index.website.user'); + $userType = $this->container->get('fos_elastica.index.website.user'); /** var Elastica_ResultSet */ $resultSet = $userType->search('bob'); @@ -323,7 +323,7 @@ If your elasticsearch type is bound to a Doctrine entity repository or a Propel you can get your entities instead of Elastica results when you perform a search. Declare that you want a Doctrine/Propel finder in your configuration: - foq_elastica: + fos_elastica: clients: default: { host: localhost, port: 9200 } indexes: @@ -339,10 +339,10 @@ Declare that you want a Doctrine/Propel finder in your configuration: provider: ~ finder: ~ -You can now use the `foq_elastica.finder.website.user` service: +You can now use the `fos_elastica.finder.website.user` service: - /** var FOQ\ElasticaBundle\Finder\TransformedFinder */ - $finder = $container->get('foq_elastica.finder.website.user'); + /** var FOS\ElasticaBundle\Finder\TransformedFinder */ + $finder = $container->get('fos_elastica.finder.website.user'); /** var array of Acme\UserBundle\Entity\User */ $users = $finder->find('bob'); @@ -366,7 +366,7 @@ You can also get both the Elastica results and the entities together from the fi You can then access the score, highlights etc. from the Elastica_Result whilst still also getting the entity. - /** var array of FOQ\ElasticaBundle\HybridResult */ + /** var array of FOS\ElasticaBundle\HybridResult */ $hybridResults = $finder->findHybrid('bob'); foreach ($hybridResults as $hybridResult) { @@ -382,16 +382,16 @@ still also getting the entity. You can also define a finder that will work on the entire index. Adjust your index configuration as per below: - foq_elastica: + fos_elastica: indexes: website: client: default finder: ~ -You can now use the index wide finder service `foq_elastica.finder.website`: +You can now use the index wide finder service `fos_elastica.finder.website`: - /** var FOQ\ElasticaBundle\Finder\MappedFinder */ - $finder = $container->get('foq_elastica.finder.website'); + /** var FOS\ElasticaBundle\Finder\MappedFinder */ + $finder = $container->get('fos_elastica.finder.website'); // Returns a mixed array of any objects mapped $results = $finder->find('bob'); @@ -403,10 +403,10 @@ can use a manager service for each driver and get a repository for an entity to against. This allows you to use the same service rather than the particular finder. For example: - /** var FOQ\ElasticaBundle\Manager\RepositoryManager */ - $repositoryManager = $container->get('foq_elastica.manager.orm'); + /** var FOS\ElasticaBundle\Manager\RepositoryManager */ + $repositoryManager = $container->get('fos_elastica.manager.orm'); - /** var FOQ\ElasticaBundle\Repository */ + /** var FOS\ElasticaBundle\Repository */ $repository = $repositoryManager->getRepository('UserBundle:User'); /** var array of Acme\UserBundle\Entity\User */ @@ -414,7 +414,7 @@ example: You can also specify the full name of the entity instead of the shortcut syntax: - /** var FOQ\ElasticaBundle\Repository */ + /** var FOS\ElasticaBundle\Repository */ $repository = $repositoryManager->getRepository('Application\UserBundle\Entity\User'); > The **2.0** branch doesn't support using `UserBundle:User` style syntax and you must use the full name of the entity. . @@ -422,21 +422,21 @@ You can also specify the full name of the entity instead of the shortcut syntax: ##### Default Manager If you are only using one driver then its manager service is automatically aliased -to `foq_elastica.manager`. So the above example could be simplified to: +to `fos_elastica.manager`. So the above example could be simplified to: - /** var FOQ\ElasticaBundle\Manager\RepositoryManager */ - $repositoryManager = $container->get('foq_elastica.manager'); + /** var FOS\ElasticaBundle\Manager\RepositoryManager */ + $repositoryManager = $container->get('fos_elastica.manager'); - /** var FOQ\ElasticaBundle\Repository */ + /** var FOS\ElasticaBundle\Repository */ $repository = $repositoryManager->getRepository('UserBundle:User'); /** var array of Acme\UserBundle\Entity\User */ $users = $repository->find('bob'); -If you use multiple drivers then you can choose which one is aliased to `foq_elastica.manager` +If you use multiple drivers then you can choose which one is aliased to `fos_elastica.manager` using the `default_manager` parameter: - foq_elastica: + fos_elastica: default_manager: mongodb #defauults to orm clients: default: { host: localhost, port: 9200 } @@ -445,7 +445,7 @@ using the `default_manager` parameter: ##### Custom Repositories As well as the default repository you can create a custom repository for an entity and add -methods for particular searches. These need to extend `FOQ\ElasticaBundle\Repository` to have +methods for particular searches. These need to extend `FOS\ElasticaBundle\Repository` to have access to the finder: ``` @@ -453,7 +453,7 @@ access to the finder: namespace Acme\ElasticaBundle\SearchRepository; -use FOQ\ElasticaBundle\Repository; +use FOS\ElasticaBundle\Repository; class UserRepository extends Repository { @@ -467,7 +467,7 @@ class UserRepository extends Repository To use the custom repository specify it in the mapping for the entity: - foq_elastica: + fos_elastica: clients: default: { host: localhost, port: 9200 } indexes: @@ -486,10 +486,10 @@ To use the custom repository specify it in the mapping for the entity: Then the custom queries will be available when using the repository returned from the manager: - /** var FOQ\ElasticaBundle\Manager\RepositoryManager */ - $repositoryManager = $container->get('foq_elastica.manager'); + /** var FOS\ElasticaBundle\Manager\RepositoryManager */ + $repositoryManager = $container->get('fos_elastica.manager'); - /** var FOQ\ElasticaBundle\Repository */ + /** var FOS\ElasticaBundle\Repository */ $repository = $repositoryManager->getRepository('UserBundle:User'); /** var array of Acme\UserBundle\Entity\User */ @@ -502,7 +502,7 @@ Alternatively you can specify the custom repository using an annotation in the e namespace Application\UserBundle\Entity; -use FOQ\ElasticaBundle\Configuration\Search; +use FOS\ElasticaBundle\Configuration\Search; /** * @Search(repositoryClass="Acme\ElasticaBundle\SearchRepository\UserRepository") @@ -521,7 +521,7 @@ If you use the Doctrine integration, you can let ElasticaBundle update the index when an object is added, updated or removed. It uses Doctrine lifecycle events. Declare that you want to update the index in real time: - foq_elastica: + fos_elastica: clients: default: { host: localhost, port: 9200 } indexes: @@ -583,7 +583,7 @@ The delete listener disregards the callback. Any setting can be specified when declaring a type. For example, to enable a custom analyzer, you could write: - foq_elastica: + fos_elastica: indexes: doc: settings: @@ -612,7 +612,7 @@ issuing a request will result in an `Elastica_Exception_Client` being thrown. Depending on your needs, it may be desirable to suppress these exceptions and allow searches to fail silently. -One way to achieve this is to override the `foq_elastica.client.class` service +One way to achieve this is to override the `fos_elastica.client.class` service container parameter with a custom class. In the following example, we override the `Client::request()` method and return the equivalent of an empty search response if an exception occurred. @@ -622,7 +622,7 @@ response if an exception occurred. namespace Acme\ElasticaBundle; -use FOQ\ElasticaBundle\Client as BaseClient; +use FOS\ElasticaBundle\Client as BaseClient; class Client extends BaseClient { @@ -648,7 +648,7 @@ Results must match at least one specified `categoryIds`, and should match the apply to queries against the `title` field. ```php -$finder = $this->container->get('foq_elastica.finder.website.article'); +$finder = $this->container->get('fos_elastica.finder.website.article'); $boolQuery = new \Elastica_Query_Bool(); $fieldQuery = new \Elastica_Query_Text(); @@ -670,7 +670,7 @@ $data = $finder->find($boolQuery); Configuration: ```yaml -foq_elastica: +fos_elastica: clients: default: { host: localhost, port: 9200 } indexes: diff --git a/Repository.php b/Repository.php index 503973e..dde07c6 100644 --- a/Repository.php +++ b/Repository.php @@ -1,8 +1,8 @@ diff --git a/Resetter.php b/Resetter.php index 2773140..5557ac7 100644 --- a/Resetter.php +++ b/Resetter.php @@ -1,6 +1,6 @@ - FOQ\ElasticaBundle\Client - Elastica_Index - Elastica_Type - FOQ\ElasticaBundle\Logger\ElasticaLogger - FOQ\ElasticaBundle\DataCollector\ElasticaDataCollector - FOQ\ElasticaBundle\Manager\RepositoryManager - FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerCollection - FOQ\ElasticaBundle\Provider\ProviderRegistry + FOS\ElasticaBundle\Client + Elastica_Index + Elastica_Type + FOS\ElasticaBundle\Logger\ElasticaLogger + FOS\ElasticaBundle\DataCollector\ElasticaDataCollector + FOS\ElasticaBundle\Manager\RepositoryManager + FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerCollection + FOS\ElasticaBundle\Provider\ProviderRegistry - + %kernel.debug% - - - + + + - + - + - + - + - + - + - + - + - + - + diff --git a/Resources/config/mongodb.xml b/Resources/config/mongodb.xml index 6d46dff..53c82f9 100644 --- a/Resources/config/mongodb.xml +++ b/Resources/config/mongodb.xml @@ -6,27 +6,27 @@ - + - + - + - + diff --git a/Resources/config/orm.xml b/Resources/config/orm.xml index 67215a1..b47cfc1 100644 --- a/Resources/config/orm.xml +++ b/Resources/config/orm.xml @@ -6,14 +6,14 @@ - + - + @@ -21,13 +21,13 @@ - + - + diff --git a/Resources/config/propel.xml b/Resources/config/propel.xml index e8fd744..a6fc32f 100644 --- a/Resources/config/propel.xml +++ b/Resources/config/propel.xml @@ -5,18 +5,18 @@ - + - + - + diff --git a/Resources/views/Collector/elastica.html.twig b/Resources/views/Collector/elastica.html.twig index f63e8cf..137dcdb 100644 --- a/Resources/views/Collector/elastica.html.twig +++ b/Resources/views/Collector/elastica.html.twig @@ -20,7 +20,7 @@ {% block menu %} - + Elastica {{ collector.querycount }} diff --git a/Subscriber/PaginateElasticaQuerySubscriber.php b/Subscriber/PaginateElasticaQuerySubscriber.php index 2f043ef..50cf36c 100644 --- a/Subscriber/PaginateElasticaQuerySubscriber.php +++ b/Subscriber/PaginateElasticaQuerySubscriber.php @@ -1,10 +1,10 @@ @@ -20,7 +20,7 @@ class ElasticaDataCollectorTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $loggerMock = $this->getMockBuilder('FOQ\ElasticaBundle\Logger\ElasticaLogger') + $loggerMock = $this->getMockBuilder('FOS\ElasticaBundle\Logger\ElasticaLogger') ->disableOriginalConstructor() ->getMock(); @@ -45,7 +45,7 @@ class ElasticaDataCollectorTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $loggerMock = $this->getMockBuilder('FOQ\ElasticaBundle\Logger\ElasticaLogger') + $loggerMock = $this->getMockBuilder('FOS\ElasticaBundle\Logger\ElasticaLogger') ->disableOriginalConstructor() ->getMock(); @@ -70,7 +70,7 @@ class ElasticaDataCollectorTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $loggerMock = $this->getMockBuilder('FOQ\ElasticaBundle\Logger\ElasticaLogger') + $loggerMock = $this->getMockBuilder('FOS\ElasticaBundle\Logger\ElasticaLogger') ->disableOriginalConstructor() ->getMock(); diff --git a/Tests/DependencyInjection/Compiler/RegisterProvidersPassTest.php b/Tests/DependencyInjection/Compiler/RegisterProvidersPassTest.php index dbbfcb0..22ae430 100644 --- a/Tests/DependencyInjection/Compiler/RegisterProvidersPassTest.php +++ b/Tests/DependencyInjection/Compiler/RegisterProvidersPassTest.php @@ -1,8 +1,8 @@ setDefinition('foq_elastica.provider_registry', $registryDefinition); - $container->setAlias('foq_elastica.index', 'foq_elastica.index.foo'); + $container->setDefinition('fos_elastica.provider_registry', $registryDefinition); + $container->setAlias('fos_elastica.index', 'fos_elastica.index.foo'); $container->setDefinition('provider.foo.a', $this->createProviderDefinition(array('type' => 'a'))); $container->setDefinition('provider.foo.b', $this->createProviderDefinition(array('index' => 'foo', 'type' => 'b'))); @@ -39,8 +39,8 @@ class RegisterProvidersPassTest extends \PHPUnit_Framework_TestCase $container = new ContainerBuilder(); $pass = new RegisterProvidersPass(); - $container->setDefinition('foq_elastica.provider_registry', new Definition()); - $container->setAlias('foq_elastica.index', 'foq_elastica.index.foo'); + $container->setDefinition('fos_elastica.provider_registry', new Definition()); + $container->setAlias('fos_elastica.index', 'fos_elastica.index.foo'); $providerDef = $this->createProviderDefinition(); $providerDef->setClass('stdClass'); @@ -58,8 +58,8 @@ class RegisterProvidersPassTest extends \PHPUnit_Framework_TestCase $container = new ContainerBuilder(); $pass = new RegisterProvidersPass(); - $container->setDefinition('foq_elastica.provider_registry', new Definition()); - $container->setAlias('foq_elastica.index', 'foq_elastica.index.foo'); + $container->setDefinition('fos_elastica.provider_registry', new Definition()); + $container->setAlias('fos_elastica.index', 'fos_elastica.index.foo'); $container->setDefinition('provider.foo.a', $this->createProviderDefinition()); @@ -68,10 +68,10 @@ class RegisterProvidersPassTest extends \PHPUnit_Framework_TestCase private function createProviderDefinition(array $attributes = array()) { - $provider = $this->getMock('FOQ\ElasticaBundle\Provider\ProviderInterface'); + $provider = $this->getMock('FOS\ElasticaBundle\Provider\ProviderInterface'); $definition = new Definition(get_class($provider)); - $definition->addTag('foq_elastica.provider', $attributes); + $definition->addTag('fos_elastica.provider', $attributes); return $definition; } diff --git a/Tests/Doctrine/AbstractListenerTest.php b/Tests/Doctrine/AbstractListenerTest.php index 16845e9..d6a8ee3 100644 --- a/Tests/Doctrine/AbstractListenerTest.php +++ b/Tests/Doctrine/AbstractListenerTest.php @@ -1,6 +1,6 @@ @@ -154,7 +154,7 @@ abstract class AbstractListenerTest extends \PHPUnit_Framework_TestCase */ public function testInvalidIsIndexableCallbacks($isIndexableCallback) { - $listener = $this->createListener($this->getMockPersister(), 'FOQ\ElasticaBundle\Tests\Doctrine\Listener\Entity', array()); + $listener = $this->createListener($this->getMockPersister(), 'FOS\ElasticaBundle\Tests\Doctrine\Listener\Entity', array()); $listener->setIsIndexableCallback($isIndexableCallback); } @@ -214,11 +214,11 @@ abstract class AbstractListenerTest extends \PHPUnit_Framework_TestCase private function getMockPersister() { - return $this->getMock('FOQ\ElasticaBundle\Persister\ObjectPersisterInterface'); + return $this->getMock('FOS\ElasticaBundle\Persister\ObjectPersisterInterface'); } } -namespace FOQ\ElasticaBundle\Tests\Doctrine\Listener; +namespace FOS\ElasticaBundle\Tests\Doctrine\Listener; class Entity { diff --git a/Tests/Doctrine/AbstractProviderTest.php b/Tests/Doctrine/AbstractProviderTest.php index 9cc7bd5..8c1be54 100644 --- a/Tests/Doctrine/AbstractProviderTest.php +++ b/Tests/Doctrine/AbstractProviderTest.php @@ -1,6 +1,6 @@ getMockForAbstractClass('FOQ\ElasticaBundle\Doctrine\AbstractProvider', array( + return $this->getMockForAbstractClass('FOS\ElasticaBundle\Doctrine\AbstractProvider', array( $this->objectPersister, $this->objectClass, $this->options, @@ -157,7 +157,7 @@ class AbstractProviderTest extends \PHPUnit_Framework_TestCase } /** - * @return FOQ\ElasticaBundle\Tests\Doctrine\ObjectManager + * @return FOS\ElasticaBundle\Tests\Doctrine\ObjectManager */ private function getMockObjectManager() { @@ -165,11 +165,11 @@ class AbstractProviderTest extends \PHPUnit_Framework_TestCase } /** - * @return FOQ\ElasticaBundle\Persister\ObjectPersisterInterface + * @return FOS\ElasticaBundle\Persister\ObjectPersisterInterface */ private function getMockObjectPersister() { - return $this->getMock('FOQ\ElasticaBundle\Persister\ObjectPersisterInterface'); + return $this->getMock('FOS\ElasticaBundle\Persister\ObjectPersisterInterface'); } } diff --git a/Tests/Doctrine/MongoDB/ListenerTest.php b/Tests/Doctrine/MongoDB/ListenerTest.php index bfc3b5c..7f1a9ab 100644 --- a/Tests/Doctrine/MongoDB/ListenerTest.php +++ b/Tests/Doctrine/MongoDB/ListenerTest.php @@ -1,8 +1,8 @@ getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') + $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder') ->disableOriginalConstructor() ->getMock(); @@ -34,17 +34,17 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $entityName = 'FOQ\ElasticaBundle\Tests\Manager\Entity'; + $entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity'; $manager = new RepositoryManager($registryMock, $readerMock); $manager->addEntity($entityName, $finderMock); $repository = $manager->getRepository($entityName); - $this->assertInstanceOf('FOQ\ElasticaBundle\Repository', $repository); + $this->assertInstanceOf('FOS\ElasticaBundle\Repository', $repository); } public function testThatGetRepositoryReturnsCustomRepository() { - $finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') + $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder') ->disableOriginalConstructor() ->getMock(); @@ -56,12 +56,12 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $entityName = 'FOQ\ElasticaBundle\Tests\Manager\Entity'; + $entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity'; $manager = new RepositoryManager($registryMock, $readerMock); - $manager->addEntity($entityName, $finderMock, 'FOQ\ElasticaBundle\Tests\Manager\CustomRepository'); + $manager->addEntity($entityName, $finderMock, 'FOS\ElasticaBundle\Tests\Manager\CustomRepository'); $repository = $manager->getRepository($entityName); - $this->assertInstanceOf('FOQ\ElasticaBundle\Tests\Manager\CustomRepository', $repository); + $this->assertInstanceOf('FOS\ElasticaBundle\Tests\Manager\CustomRepository', $repository); } /** @@ -69,7 +69,7 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase */ public function testThatGetRepositoryThrowsExceptionIfEntityNotConfigured() { - $finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') + $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder') ->disableOriginalConstructor() ->getMock(); @@ -81,7 +81,7 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $entityName = 'FOQ\ElasticaBundle\Tests\Manager\Entity'; + $entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity'; $manager = new RepositoryManager($registryMock, $readerMock); $manager->addEntity($entityName, $finderMock); @@ -93,7 +93,7 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase */ public function testThatGetRepositoryThrowsExceptionIfCustomRepositoryNotFound() { - $finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') + $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder') ->disableOriginalConstructor() ->getMock(); @@ -105,16 +105,16 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $entityName = 'FOQ\ElasticaBundle\Tests\Manager\Entity'; + $entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity'; $manager = new RepositoryManager($registryMock, $readerMock); - $manager->addEntity($entityName, $finderMock, 'FOQ\ElasticaBundle\Tests\MissingRepository'); + $manager->addEntity($entityName, $finderMock, 'FOS\ElasticaBundle\Tests\MissingRepository'); $manager->getRepository('Missing Entity'); } public function testThatGetRepositoryWorksWithShortEntityName() { - $finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') + $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder') ->disableOriginalConstructor() ->getMock(); @@ -127,9 +127,9 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase ->getMock(); $shortEntityName = 'TestBundle:Entity'; - $entityName = 'FOQ\ElasticaBundle\Tests\Manager\Entity'; + $entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity'; $shortPath = 'TestBundle'; - $fullPath = 'FOQ\ElasticaBundle\Tests\Manager'; + $fullPath = 'FOS\ElasticaBundle\Tests\Manager'; $registryMock->expects($this->once()) ->method('getAliasNamespace') @@ -139,7 +139,7 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase $manager = new RepositoryManager($registryMock, $readerMock); $manager->addEntity($entityName, $finderMock); $repository = $manager->getRepository($shortEntityName); - $this->assertInstanceOf('FOQ\ElasticaBundle\Repository', $repository); + $this->assertInstanceOf('FOS\ElasticaBundle\Repository', $repository); } } diff --git a/Tests/IndexManagerTest.php b/Tests/IndexManagerTest.php index 63e6ded..884a864 100644 --- a/Tests/IndexManagerTest.php +++ b/Tests/IndexManagerTest.php @@ -1,8 +1,8 @@ diff --git a/Tests/Manager/RepositoryManagerTest.php b/Tests/Manager/RepositoryManagerTest.php index 484bf12..d6be333 100644 --- a/Tests/Manager/RepositoryManagerTest.php +++ b/Tests/Manager/RepositoryManagerTest.php @@ -1,8 +1,8 @@ getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') + $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder') ->disableOriginalConstructor() ->getMock(); @@ -24,17 +24,17 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $entityName = 'FOQ\ElasticaBundle\Tests\Manager\Entity'; + $entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity'; $manager = new RepositoryManager($readerMock); $manager->addEntity($entityName, $finderMock); $repository = $manager->getRepository($entityName); - $this->assertInstanceOf('FOQ\ElasticaBundle\Repository', $repository); + $this->assertInstanceOf('FOS\ElasticaBundle\Repository', $repository); } public function testThatGetRepositoryReturnsCustomRepository() { - $finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') + $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder') ->disableOriginalConstructor() ->getMock(); @@ -42,12 +42,12 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $entityName = 'FOQ\ElasticaBundle\Tests\Manager\Entity'; + $entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity'; $manager = new RepositoryManager($readerMock); - $manager->addEntity($entityName, $finderMock, 'FOQ\ElasticaBundle\Tests\Manager\CustomRepository'); + $manager->addEntity($entityName, $finderMock, 'FOS\ElasticaBundle\Tests\Manager\CustomRepository'); $repository = $manager->getRepository($entityName); - $this->assertInstanceOf('FOQ\ElasticaBundle\Tests\Manager\CustomRepository', $repository); + $this->assertInstanceOf('FOS\ElasticaBundle\Tests\Manager\CustomRepository', $repository); } /** @@ -55,7 +55,7 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase */ public function testThatGetRepositoryThrowsExceptionIfEntityNotConfigured() { - $finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') + $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder') ->disableOriginalConstructor() ->getMock(); @@ -63,7 +63,7 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $entityName = 'FOQ\ElasticaBundle\Tests\Manager\Entity'; + $entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity'; $manager = new RepositoryManager($readerMock); $manager->addEntity($entityName, $finderMock); @@ -75,7 +75,7 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase */ public function testThatGetRepositoryThrowsExceptionIfCustomRepositoryNotFound() { - $finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') + $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder') ->disableOriginalConstructor() ->getMock(); @@ -83,10 +83,10 @@ class RepositoryManagerTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); - $entityName = 'FOQ\ElasticaBundle\Tests\Manager\Entity'; + $entityName = 'FOS\ElasticaBundle\Tests\Manager\Entity'; $manager = new RepositoryManager($readerMock); - $manager->addEntity($entityName, $finderMock, 'FOQ\ElasticaBundle\Tests\MissingRepository'); + $manager->addEntity($entityName, $finderMock, 'FOS\ElasticaBundle\Tests\MissingRepository'); $manager->getRepository('Missing Entity'); } diff --git a/Tests/Persister/ObjectPersisterTest.php b/Tests/Persister/ObjectPersisterTest.php index 335ac4e..ea5dfdf 100644 --- a/Tests/Persister/ObjectPersisterTest.php +++ b/Tests/Persister/ObjectPersisterTest.php @@ -1,9 +1,9 @@ @@ -14,7 +14,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase { $testQuery = 'Test Query'; - $finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') + $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder') ->disableOriginalConstructor() ->getMock(); $finderMock->expects($this->once()) @@ -30,7 +30,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase $testQuery = 'Test Query'; $testLimit = 20; - $finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') + $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder') ->disableOriginalConstructor() ->getMock(); $finderMock->expects($this->once()) @@ -45,7 +45,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase { $testQuery = 'Test Query'; - $finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') + $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder') ->disableOriginalConstructor() ->getMock(); $finderMock->expects($this->once()) @@ -61,7 +61,7 @@ class RepositoryTest extends \PHPUnit_Framework_TestCase $testQuery = 'Test Query'; $testLimit = 20; - $finderMock = $this->getMockBuilder('FOQ\ElasticaBundle\Finder\TransformedFinder') + $finderMock = $this->getMockBuilder('FOS\ElasticaBundle\Finder\TransformedFinder') ->disableOriginalConstructor() ->getMock(); $finderMock->expects($this->once()) diff --git a/Tests/ResetterTest.php b/Tests/ResetterTest.php index 754310c..3b54883 100644 --- a/Tests/ResetterTest.php +++ b/Tests/ResetterTest.php @@ -1,8 +1,8 @@ getMock('FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface'); + $transformer1 = $this->getMock('FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface'); $transformer1->expects($this->any()) ->method('getObjectClass') - ->will($this->returnValue('FOQ\ElasticaBundle\Tests\Transformer\POPO')); + ->will($this->returnValue('FOS\ElasticaBundle\Tests\Transformer\POPO')); $transformer1->expects($this->any()) ->method('getIdentifierField') ->will($this->returnValue('id')); - $transformer2 = $this->getMock('FOQ\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface'); + $transformer2 = $this->getMock('FOS\ElasticaBundle\Transformer\ElasticaToModelTransformerInterface'); $transformer2->expects($this->any()) ->method('getObjectClass') - ->will($this->returnValue('FOQ\ElasticaBundle\Tests\Transformer\POPO2')); + ->will($this->returnValue('FOS\ElasticaBundle\Tests\Transformer\POPO2')); $transformer2->expects($this->any()) ->method('getIdentifierField') @@ -44,8 +44,8 @@ class ElasticaToModelTransformerCollectionTest extends \PHPUnit_Framework_TestCa $objectClasses = $this->collection->getObjectClass(); $this->assertEquals(array( - 'type1' => 'FOQ\ElasticaBundle\Tests\Transformer\POPO', - 'type2' => 'FOQ\ElasticaBundle\Tests\Transformer\POPO2' + 'type1' => 'FOS\ElasticaBundle\Tests\Transformer\POPO', + 'type2' => 'FOS\ElasticaBundle\Tests\Transformer\POPO2' ), $objectClasses); } diff --git a/Tests/Transformer/ModelToElasticaAutoTransformerTest.php b/Tests/Transformer/ModelToElasticaAutoTransformerTest.php index fe979e7..cb6c99e 100644 --- a/Tests/Transformer/ModelToElasticaAutoTransformerTest.php +++ b/Tests/Transformer/ModelToElasticaAutoTransformerTest.php @@ -1,8 +1,8 @@ - + ./Tests