/**
  * @expectedException Symfony\Component\Form\Exception\FormException
  */
 public function testChoicesMustBeManaged()
 {
     $document1 = new Document(1, 'Foo');
     $document2 = new Document(2, 'Bar');
     // no persist here!
     $choiceList = new DocumentChoiceList($this->documentManager, self::DOCUMENT_CLASS, 'name', null, array($document1, $document2));
     // triggers loading -> exception
     $choiceList->getChoices();
 }
 /**
  * {@inheritdoc}
  */
 public function getChoices()
 {
     $choices = parent::getChoices();
     $array = array();
     foreach ($choices as $value => $label) {
         $array[] = array('value' => $value, 'label' => $label);
     }
     return $array;
 }