public function testMoveNode() { $dnOld = $this->_createDn('ou=Test1,'); $dnNew = $this->_createDn('ou=Test,'); $node = 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\Node::fromLDAP($dnNew, $this->_getLDAP()); $node->move($dnOld); $node->update(); $this->assertFalse($this->_getLDAP()->exists($dnNew)); $this->assertTrue($this->_getLDAP()->exists($dnOld)); $node = Node\Node::fromLDAP($dnOld, $this->_getLDAP()); $node->rename($dnNew); $node->update(); $this->assertFalse($this->_getLDAP()->exists($dnOld)); $this->assertTrue($this->_getLDAP()->exists($dnNew)); }
public function testLoadFromLDAPWithDnObject() { $dn = LDAP\DN::fromString($this->_createDn('ou=Test1,')); $node = Node\Node::fromLDAP($dn, $this->_getLDAP()); $this->assertType('Zend\\LDAP\\Node\\Node', $node); $this->assertTrue($node->isAttached()); }