本文整理匯總了PHP中Zend_Ldap_Node::create方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_Ldap_Node::create方法的具體用法?PHP Zend_Ldap_Node::create怎麽用?PHP Zend_Ldap_Node::create使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_Ldap_Node
的用法示例。
在下文中一共展示了Zend_Ldap_Node::create方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testGetChanges
public function testGetChanges()
{
$node = $this->_createTestNode();
$node->host = array('d');
$node->empty = 'not Empty';
unset($node->boolean);
$changes = $node->getChanges();
$this->assertEquals(array('add' => array('empty' => array('not Empty')), 'delete' => array('boolean' => array()), 'replace' => array('host' => array('d'))), $changes);
$node = Zend_Ldap_Node::create('uid=test,dc=example,dc=org', array('account'));
$node->host = 'host';
unset($node->cn);
unset($node['sn']);
$node['givenName'] = 'givenName';
$node->appendToAttribute('objectClass', 'domain');
$this->assertEquals(array('uid' => array('test'), 'objectclass' => array('account', 'domain'), 'host' => array('host'), 'givenname' => array('givenName')), $node->getChangedData());
$this->assertEquals(array('add' => array('uid' => array('test'), 'objectclass' => array('account', 'domain'), 'host' => array('host'), 'givenname' => array('givenName')), 'delete' => array(), 'replace' => array()), $node->getChanges());
}
示例2: testMoveDeletedNewNode
public function testMoveDeletedNewNode()
{
$dnOld = $this->_createDn('ou=Test,');
$dnNew = $this->_createDn('ou=TestNew,');
$node1 = Zend_Ldap_Node::create($dnOld, array('organizationalUnit'));
$node1->setDn($dnNew);
$node1->delete();
$node1->update($this->_getLdap());
$this->assertFalse($this->_getLdap()->exists($dnOld));
$this->assertFalse($this->_getLdap()->exists($dnNew));
}