예제 #1
0
 public function testPopulateFromModel()
 {
     $form = new Admin_Form_Document_Files();
     $document = new Opus_Document(84);
     $this->assertEquals(1, count($form->getSubForms()));
     $form->populateFromModel($document);
     $this->assertEquals(3, count($form->getSubForms()));
     $this->assertNotNull($form->getSubForm('File0'));
     $this->assertInstanceOf('Admin_Form_Document_File', $form->getSubForm('File0'));
     $this->assertNotNull($form->getSubForm('File0')->getModel());
     $this->assertNotNull($form->getSubForm('File1'));
     $this->assertInstanceOf('Admin_Form_Document_File', $form->getSubForm('File1'));
     $this->assertNotNull($form->getSubForm('File1')->getModel());
 }