public function testPopulateFromModelWithRootCollectionWithoutName() { $this->useEnglish(); $form = new Admin_Form_Document_Collection(); $collection = new Opus_Collection(2); // Root-Collection DDC-Klassifikation $form->populateFromModel($collection); $this->assertEquals(2, $form->getElement('Id')->getValue()); $this->assertNotEmpty($form->getLegend()); $this->assertNotEmpty($form->getElement('Edit')->getLabel()); $this->assertEquals('Dewey Decimal Classification', $form->getElement('Edit')->getLabel()); }
protected function _addCollection($colId) { $collection = new Opus_Collection($colId); $collectionRole = $collection->getRole(); $roleName = $collectionRole->getName(); $roleForm = $this->_getRoleForm($roleName); $collectionForm = new Admin_Form_Document_Collection(); $collectionForm->populateFromModel($collection); $position = count($roleForm->getSubForms()); $roleForm->addSubForm($collectionForm, 'collection' . $position); }