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