spec\LdapTools\AttributeConverter\ConvertLogonWorkstationsSpec::it_should_aggregate_values_when_converting_an_array_of_addresses_to_ldap_on_modification PHP Метод

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

    function it_should_aggregate_values_when_converting_an_array_of_addresses_to_ldap_on_modification($connection)
    {
        $connection->getConfig()->willReturn(new DomainConfiguration('foo.bar'));
        $connection->execute(Argument::that(function ($operation) {
            return $operation->getFilter() == '(&(objectClass=*))' && $operation->getAttributes() == ['userWorkstations'] && $operation->getBaseDn() == 'cn=foo,dc=foo,dc=bar';
        }))->willReturn($this->expectedResult);
        $this->setOperationType(AttributeConverterInterface::TYPE_MODIFY);
        $this->setBatch(new Batch(Batch::TYPE['ADD'], 'logonWorkstations', ['pc1']));
        $this->toLdap(['pc1'])->shouldBeEqualTo('foo,bar,pc1');
        $this->getBatch()->getModType()->shouldBeEqualTo(Batch::TYPE['REPLACE']);
        $this->setBatch(new Batch(Batch::TYPE['REMOVE'], 'logonWorkstations', ['foo']));
        $this->toLdap(['foo'])->shouldBeEqualTo('bar,pc1');
        $this->setBatch(new Batch(Batch::TYPE['REPLACE'], '', ['bar', 'foo', 'test']));
        $this->toLdap(['bar', 'foo', 'test'])->shouldBeEqualTo('bar,foo,test');
    }