本文整理汇总了PHP中Tinebase_User::syncContact方法的典型用法代码示例。如果您正苦于以下问题:PHP Tinebase_User::syncContact方法的具体用法?PHP Tinebase_User::syncContact怎么用?PHP Tinebase_User::syncContact使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Tinebase_User
的用法示例。
在下文中一共展示了Tinebase_User::syncContact方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testSyncLists
/**
* testSyncLists
*
* @see http://forge.tine20.org/mantisbt/view.php?id=5768
*/
public function testSyncLists()
{
$group = $this->objects['initialGroup'];
Tinebase_User::syncContact($this->objects['account1']);
Tinebase_User::getInstance()->updateUserInSqlBackend($this->objects['account1']);
$this->testSetGroupMembers();
Tinebase_Group::syncListsOfUserContact(array($group->getId()), $this->objects['account1']->contact_id);
$group = Tinebase_Group::getInstance()->getGroupById($this->objects['initialGroup']);
$this->assertTrue(!empty($group->list_id), 'list id empty: ' . print_r($group->toArray(), TRUE));
$list = Addressbook_Controller_List::getInstance()->get($group->list_id);
$this->assertEquals($group->getId(), $list->group_id);
$this->assertEquals($group->name, $list->name);
$this->assertTrue(!empty($list->members), 'list members empty: ' . print_r($list->toArray(), TRUE));
$this->assertEquals($this->objects['account1']->contact_id, $list->members[0]);
$appConfigDefaults = Admin_Controller::getInstance()->getConfigSettings();
$internal = $appConfigDefaults[Admin_Model_Config::DEFAULTINTERNALADDRESSBOOK];
$this->assertEquals($internal, $list->container_id);
// sync again -> should not change anything
Tinebase_Group::syncListsOfUserContact(array($group->getId()), $this->objects['account1']->contact_id);
$listAgain = Addressbook_Controller_List::getInstance()->get($group->list_id);
$this->assertEquals($list->toArray(), $listAgain->toArray());
}