public function testCreateViewAttrAsPropertyPathInstance()
 {
     $list = $this->getMock('Symfony\\Component\\Form\\ChoiceList\\ChoiceListInterface');
     $this->decoratedFactory->expects($this->once())->method('createView')->with($list, null, null, null, null, $this->isInstanceOf('\\Closure'))->will($this->returnCallback(function ($list, $preferred, $label, $index, $groupBy, $attr) {
         return $attr((object) array('property' => 'attr'));
     }));
     $this->assertSame('attr', $this->factory->createView($list, null, null, null, null, new PropertyPath('property')));
 }