示例#1
0
 public function testMoveNode()
 {
     $dnOld = $this->_createDn('ou=Test1,');
     $dnNew = $this->_createDn('ou=Test,');
     $node = Node::fromLDAP($dnOld, $this->_getLDAP());
     $node->setDn($dnNew);
     $node->update();
     $this->assertFalse($this->_getLDAP()->exists($dnOld));
     $this->assertTrue($this->_getLDAP()->exists($dnNew));
     $node = Node::fromLDAP($dnNew, $this->_getLDAP());
     $node->move($dnOld);
     $node->update();
     $this->assertFalse($this->_getLDAP()->exists($dnNew));
     $this->assertTrue($this->_getLDAP()->exists($dnOld));
     $node = Node::fromLDAP($dnOld, $this->_getLDAP());
     $node->rename($dnNew);
     $node->update();
     $this->assertFalse($this->_getLDAP()->exists($dnOld));
     $this->assertTrue($this->_getLDAP()->exists($dnNew));
 }
示例#2
0
 public function testLoadFromLDAPWithDnObject()
 {
     $dn = Ldap\Dn::fromString($this->_createDn('ou=Test1,'));
     $node = Node::fromLDAP($dn, $this->_getLDAP());
     $this->assertInstanceOf('Zend\\Ldap\\Node', $node);
     $this->assertTrue($node->isAttached());
 }