public function testConfiguredNamerRetrievedFromContainer()
 {
     $obj = new DummyEntity();
     $mappings = array('dummy_file' => array('upload_destination' => 'images', 'delete_on_remove' => true, 'delete_on_update' => true, 'namer' => 'my.custom.namer', 'inject_on_load' => true, 'directory_namer' => null));
     $namer = $this->getMock('Vich\\UploaderBundle\\Naming\\NamerInterface');
     $this->container->expects($this->once())->method('get')->with('my.custom.namer')->will($this->returnValue($namer));
     $this->metadata->expects($this->once())->method('isUploadable')->with('Vich\\UploaderBundle\\Tests\\DummyEntity')->will($this->returnValue(true));
     $this->metadata->expects($this->once())->method('getUploadableFields')->with('Vich\\UploaderBundle\\Tests\\DummyEntity')->will($this->returnValue(array('file' => array('mapping' => 'dummy_file', 'propertyName' => 'file', 'fileNameProperty' => 'fileName'))));
     $factory = new PropertyMappingFactory($this->container, $this->metadata, $mappings);
     $mappings = $factory->fromObject($obj);
     $this->assertEquals(1, count($mappings));
     $mapping = $mappings['dummy_file'];
     $this->assertEquals($namer, $mapping->getNamer());
     $this->assertTrue($mapping->hasNamer());
 }