public function testMoveDeletedNewNode() { $dnOld = $this->_createDn('ou=Test,'); $dnNew = $this->_createDn('ou=TestNew,'); $node1 = Node\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)); }
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 = Node\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()); }