public function lookupMetadataProviderFactoryForEntityTableMetadata(EntityTableMetadata $tableMetadata)
 {
     if (isset($this->metadataProviderFactories[$tableMetadata->getEntityType()])) {
         return $this->metadataProviderFactories[$tableMetadata->getEntityType()];
     } else {
         return null;
     }
 }
 public function testGetProviderForWithEntityTable()
 {
     $em = $this->getMock('Doctrine\\ORM\\EntityManager', array(), array(), '', false);
     $tableMetadata = new EntityTableMetadata('entitytype_1');
     $entityTableMetadataProviderFactory = $this->getMock('Bluegrass\\Metadata\\Bundle\\MetadataBundle\\Model\\MetadataProvider\\Factory\\EntityTableMetadataProviderFactory', array(), array(), '', false);
     $entityTableMetadataProvider = $this->getMock('Bluegrass\\Metadata\\Bundle\\MetadataBundle\\Model\\MetadataProvider\\EntityTableMetadataProvider', array(), array(), '', false);
     $entityTableMetadataProviderFactory->expects($this->once())->method('create')->will($this->returnValue($entityTableMetadataProvider));
     $metadataProviderFactory = new MetadataProviderFactory($em);
     $metadataProviderFactory->setProvider($tableMetadata->getEntityType(), $entityTableMetadataProviderFactory);
     $this->assertEquals($entityTableMetadataProvider, $metadataProviderFactory->getProviderFor($tableMetadata));
 }