function it_should_hydrate_a_modify_operation_to_ldap($connection)
{
$this->setLdapObjectSchema($this->schema);
$this->setOperationType(AttributeConverterInterface::TYPE_CREATE);
$this->setLdapConnection($connection);
$dn = 'cn=foo,dc=example,dc=local';
$batches = new BatchCollection($dn);
$batches->add(new Batch(Batch::TYPE['REPLACE'], 'username', 'foobar'));
$batches->add(new Batch(Batch::TYPE['REMOVE'], 'password', 'bar'));
$expected = [['attrib' => "sAMAccountName", 'modtype' => 3, 'values' => [0 => "foobar"]], ['attrib' => "unicodePwd", 'modtype' => 2, 'values' => [0 => (new EncodeWindowsPassword())->toLdap('bar')]]];
$operation = new BatchModifyOperation($dn, $batches);
$this->hydrateToLdap($operation)->getBatchCollection()->getBatchArray()->shouldBeEqualTo($expected);
}