示例#1
0
 public function testOneRelationSaving()
 {
     $this->_initAdapter('Comment');
     $article = array('id' => 1, 'name' => 'Test');
     $this->_adapter->expects($this->once())->method('getOneRecords')->will($this->returnValue(array($article)));
     $form = new CU_Form_Model(array('model' => 'Comment', 'adapter' => $this->_adapter));
     $form->getElementForRelation('Article')->setValue(1);
     $form->getElementForColumn('sender')->setValue('Sender');
     $this->_adapter->expects($this->any())->method('setRecordValue');
     $form->save();
 }