Ejemplo n.º 1
0
 /**
  * @param int $expectedCallsOfGetAllMetadata
  */
 protected function initialiseAliases($expectedCallsOfGetAllMetadata)
 {
     $this->metadataFactory->expects($this->exactly($expectedCallsOfGetAllMetadata))->method('getAllMetadata')->willReturn([new ClassMetadata('Test\\Entity1'), new ClassMetadata('Test\\Entity2')]);
     $entityAliasProvider = $this->getMock('Oro\\Bundle\\EntityBundle\\Provider\\EntityAliasProviderInterface');
     $entityAliasProvider->expects($this->any())->method('getEntityAlias')->willReturnMap([['Test\\Entity1', new EntityAlias('entity1_alias', 'entity1_plural_alias')], ['Test\\Entity2', new EntityAlias('entity2_alias', 'entity2_plural_alias')]]);
     $this->entityAliasResolver->addProvider($entityAliasProvider);
 }