本文整理汇总了PHP中Addressbook_Controller_Contact::useNotes方法的典型用法代码示例。如果您正苦于以下问题:PHP Addressbook_Controller_Contact::useNotes方法的具体用法?PHP Addressbook_Controller_Contact::useNotes怎么用?PHP Addressbook_Controller_Contact::useNotes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Addressbook_Controller_Contact
的用法示例。
在下文中一共展示了Addressbook_Controller_Contact::useNotes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testUseNotes
/**
* test useNotes
*/
public function testUseNotes()
{
$contact = $this->objects['initialContact'];
$contact1 = clone $contact;
$contact1->notes = array(new Tinebase_Record_RecordSet('Tinebase_Model_Note', array($this->objects['note'])));
$contact->notes = array(new Tinebase_Record_RecordSet('Tinebase_Model_Note', array($this->objects['note'])));
$newcontact1 = $this->_instance->create($contact1);
$this->_instance->delete($newcontact1);
$this->_instance->useNotes(false);
$this->objects['contact'] = $this->_instance->create($contact);
$compStr = 'Array
(
[0] => Array
(
[note_type_id] => 1
[note] => phpunit test note
[record_backend] => Sql
[id] =>
)
)';
$this->assertTrue($newcontact1->has('notes'));
$this->assertEquals($compStr, $newcontact1->notes[0]->note);
$this->setExpectedException('Tinebase_Exception_NotFound');
$this->objects['contact']->notes[0]->note = 'note';
}