spec\LdapTools\AttributeConverter\ConvertValueToDnSpec::it_should_allow_specifying_the_attribute_to_select_when_converting PHP Метод

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

    function it_should_allow_specifying_the_attribute_to_select_when_converting($connection)
    {
        $connection->execute(Argument::that(function ($operation) {
            return $operation->getAttributes() == ['foo'];
        }))->shouldBeCalled()->willReturn($this->entryWithSelect);
        $this->setOptions(['foo' => ['attribute' => 'cn', 'filter' => ['objectClass' => 'bar'], 'select' => 'foo']]);
        $this->setLdapConnection($connection);
        $this->setAttribute('foo');
        $this->toLdap('Foo')->shouldBeEqualTo('bar');
        $this->toLdap(new LdapObject(['foo' => 'bar']))->shouldBeEqualTo('bar');
        $this->shouldThrow('\\LdapTools\\Exception\\AttributeConverterException')->duringToLdap(new LdapObject(['dn' => 'foo']));
    }