/**
  * Initialisiert das Formular mit einer Collection.
  * @param Opus_Collection $collection
  */
 public function populateFromModel($collection)
 {
     $this->getElement(self::ELEMENT_ID)->setValue($collection->getId());
     $displayName = $this->getDisplayNameForCollection($collection);
     $this->getElement(self::ELEMENT_EDIT)->setLabel($displayName);
     $this->setLegend($displayName);
 }
 public function testPopulateFromPost()
 {
     $form = new Admin_Form_Document_Collection();
     $post = array('Id' => '499');
     $form->populateFromPost($post);
     $collection = new Opus_Collection(499);
     $this->assertEquals($collection->getDisplayName(), $form->getLegend());
     $this->assertEquals($collection->getId(), $form->getElement('Id')->getValue());
 }