spec\LdapTools\Object\LdapObjectManagerSpec::it_should_update_a_ldap_object_using_batch_modify PHP Метод

it_should_update_a_ldap_object_using_batch_modify() публичный Метод

    function it_should_update_a_ldap_object_using_batch_modify($connection)
    {
        $dn = 'cn=foo,dc=foo,dc=bar';
        $batch = new BatchCollection($dn);
        $batch->add(new Batch(Batch::TYPE['REPLACE'], 'givenName', 'Chad'));
        $batch->add(new Batch(Batch::TYPE['ADD'], 'sn', 'Sikorra'));
        $batch->add(new Batch(Batch::TYPE['REMOVE'], 'sAMAccountName', 'csikorra'));
        $batch->add(new Batch(Batch::TYPE['REMOVE_ALL'], 'mail'));
        $connection->execute(new BatchModifyOperation($dn, $batch))->willReturn(null);
        $ldapObject = new LdapObject(['dn' => $dn], 'user');
        $ldapObject->set('firstName', 'Chad');
        $ldapObject->add('lastName', 'Sikorra');
        $ldapObject->remove('username', 'csikorra');
        $ldapObject->reset('emailAddress');
        $this->persist($ldapObject);
    }