/**
  * @expectedException RuntimeException
  */
 public function testThatGetRepositoryThrowsExceptionIfCustomRepositoryNotFound()
 {
     $finderMock = $this->getMockBuilder('FOQ\\ElasticaBundle\\Finder\\TransformedFinder')->disableOriginalConstructor()->getMock();
     $readerMock = $this->getMockBuilder('Doctrine\\Common\\Annotations\\Reader')->disableOriginalConstructor()->getMock();
     $entityName = 'FOQ\\ElasticaBundle\\Tests\\Manager\\Entity';
     $manager = new RepositoryManager($readerMock);
     $manager->addEntity($entityName, $finderMock, 'FOQ\\ElasticaBundle\\Tests\\MissingRepository');
     $manager->getRepository('Missing Entity');
 }
 /**
  * Return repository for entity
  *
  * Returns custom repository if one specified otherwise
  * returns a basic respository.
  */
 public function getRepository($entityName)
 {
     $realEntityName = $entityName;
     if (strpos($entityName, ':') !== false) {
         list($namespaceAlias, $simpleClassName) = explode(':', $entityName);
         $realEntityName = $this->managerRegistry->getAliasNamespace($namespaceAlias) . '\\' . $simpleClassName;
     }
     return parent::getRepository($realEntityName);
 }