Exemplo n.º 1
0
 public function testCreatingFormWithOneRelation()
 {
     $this->_initAdapter('Comment');
     $this->_adapter->expects($this->once())->method('getOneRecords')->with($this->_relations['Comment']['Article'])->will($this->returnValue(array()));
     $form = new CU_Form_Model(array('model' => 'Comment', 'adapter' => $this->_adapter));
     $name = $form->getRelationElementName('Article');
     $elem = $form->getElementForRelation('Article');
     $this->assertNotNull($elem);
     $this->assertNotEquals('', $name);
     $this->assertEquals($elem->getName(), $name);
 }