本文整理汇总了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);