function it_should_generate_add_operations_based_off_a_name_guid_sid_and_LdapObject_on_a_create_operation($connection, \LdapTools\Operation\AddOperation $operation)
 {
     $sid = 'S-1-5-21-1004336348-1177238915-682003330-512';
     $sidHex = '\\01\\05\\00\\00\\00\\00\\00\\05\\15\\00\\00\\00\\dc\\f4\\dc\\3b\\83\\3d\\2b\\46\\82\\8b\\a6\\28\\00\\02\\00\\00';
     $guid = 'a1131cd3-902b-44c6-b49a-1f6a567cda25';
     $guidHex = '\\d3\\1c\\13\\a1\\2b\\90\\c6\\44\\b4\\9a\\1f\\6a\\56\\7c\\da\\25';
     $dn = 'cn=foo,dc=example,dc=local';
     $objectDn = 'CN=SomeGroup,OU=Employees,DC=example,DC=com';
     $ldapObject = new LdapObject(['dn' => $objectDn], ['group'], 'group', 'group');
     $connection->execute(Argument::that(function ($operation) {
         return $operation->getFilter() == '(&(&(objectClass=bar))(cn=Foo))';
     }))->willReturn($this->entry);
     $connection->execute(Argument::that(function ($operation) use($guid, $guidHex) {
         return $operation->getFilter() == '(&(&(objectClass=bar))(|(objectGuid=' . $guidHex . ')(cn=' . $guid . ')))';
     }))->willReturn($this->entryGuid);
     $connection->execute(Argument::that(function ($operation) use($sid, $sidHex) {
         return $operation->getFilter() == '(&(&(objectClass=bar))(|(objectSid=' . $sidHex . ')(cn=' . $sid . ')))';
     }))->willReturn($this->entrySid);
     $this->setOptions(['foo' => ['to_attribute' => 'member', 'attribute' => 'cn', 'filter' => ['objectClass' => 'bar']]]);
     $this->setOperation($operation);
     $this->setLdapConnection($connection);
     $this->setAttribute('foo');
     $this->setOperationType(AttributeConverterInterface::TYPE_CREATE);
     $this->setDn($dn);
     $operation->getDn()->willReturn($dn);
     $nameDn = $this->entry[0]['distinguishedname'][0];
     $guidDn = $this->entryGuid[0]['distinguishedname'][0];
     $sidDn = $this->entrySid[0]['distinguishedname'][0];
     foreach ([$nameDn, $sidDn, $guidDn, $objectDn] as $groupDn) {
         $operation->addPostOperation(Argument::that(function ($op) use($dn, $groupDn) {
             return $op instanceof BatchModifyOperation && call_user_func($op->getBatchCollection()->toArray()[0]->getValues()[0]) == $dn && $op->getBatchCollection()->getDn() == $groupDn;
         }))->shouldBeCalled();
     }
     $this->toLdap(['Foo', $guid, $sid, $ldapObject])->shouldBeArray();
 }