本文整理匯總了PHP中UserGroup::initAsSpecimen方法的典型用法代碼示例。如果您正苦於以下問題:PHP UserGroup::initAsSpecimen方法的具體用法?PHP UserGroup::initAsSpecimen怎麽用?PHP UserGroup::initAsSpecimen使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UserGroup
的用法示例。
在下文中一共展示了UserGroup::initAsSpecimen方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testUserGroupCreate
/**
*/
public function testUserGroupCreate()
{
global $conf,$user,$langs,$db;
$conf=$this->savconf;
$user=$this->savuser;
$langs=$this->savlangs;
$db=$this->savdb;
$localobject=new UserGroup($this->savdb);
$localobject->initAsSpecimen();
$result=$localobject->create($user);
$this->assertLessThan($result, 0);
print __METHOD__." result=".$result."\n";
return $result;
}
示例2: UserGroup
/*
* Test de la connexion
*/
if ($conf->global->LDAP_SYNCHRO_ACTIVE == 'dolibarr2ldap') {
$butlabel = $langs->trans("LDAPTestSynchroGroup");
$testlabel = 'testgroup';
$key = $conf->global->LDAP_KEY_GROUPS;
$dn = $conf->global->LDAP_GROUP_DN;
$objectclass = $conf->global->LDAP_GROUP_OBJECT_CLASS;
show_ldap_test_button($butlabel, $testlabel, $key, $dn, $objectclass);
}
if (function_exists("ldap_connect")) {
if ($_GET["action"] == 'testgroup') {
// Creation objet
$object = new UserGroup($db);
$object->initAsSpecimen();
// Test synchro
$ldap = new Ldap();
$result = $ldap->connect_bind();
if ($result > 0) {
$info = $object->_load_ldap_info();
$dn = $object->_load_ldap_dn($info);
// Get a gid number for objectclass PosixGroup
if (in_array('posixGroup', $info['objectclass'])) {
$info['gidNumber'] = $ldap->getNextGroupGid();
}
$result1 = $ldap->delete($dn);
// To be sure to delete existing records
$result2 = $ldap->add($dn, $info, $user);
// Now the test
$result3 = $ldap->delete($dn);