public function testCreateFromChoicesPropertyPathInstance()
 {
     $choices = array((object) array('property' => 'value'));
     $this->decoratedFactory->expects($this->once())->method('createListFromChoices')->with($choices, $this->isInstanceOf('\\Closure'))->will($this->returnCallback(function ($choices, $callback) {
         return array_map($callback, $choices);
     }));
     $this->assertSame(array('value'), $this->factory->createListFromChoices($choices, new PropertyPath('property')));
 }
Ejemplo n.º 2
0
 public function testCreateFromChoicesAssumeNullIfValuePropertyPathUnreadable()
 {
     $choices = array(null);
     $this->decoratedFactory->expects($this->once())->method('createListFromChoices')->with($choices, $this->isInstanceOf('\\Closure'))->will($this->returnCallback(function ($choices, $callback) {
         return array_map($callback, $choices);
     }));
     $this->assertSame(array(null), $this->factory->createListFromChoices($choices, 'property'));
 }