LdapTools\Schema\LdapObjectSchema::setDefaultValues PHP Method

setDefaultValues() public method

Set the default values when creating this object.
public setDefaultValues ( array $defaultValues )
$defaultValues array
    public function setDefaultValues(array $defaultValues)
    {
        $this->defaultValues = $defaultValues;
    }

Usage Example

Esempio n. 1
0
 function it_should_merge_default_attributes_to_ldap()
 {
     $schema = new LdapObjectSchema('ad', 'user');
     $schema->setDefaultValues(['phoneNumber' => '555-2368', 'emailAddress' => '%firstname%.lastname%@%whoyougonnacall%', 'enabled' => false]);
     $this->setLdapObjectSchema($schema);
     $this->setParameter('whoyougonnacall', 'ghostbusters.local');
     $this->hydrateToLdap($this->objectToLdap)->shouldHaveKeyWithValue('phoneNumber', '555-2368');
     $this->hydrateToLdap($this->objectToLdap)->shouldNotContain('*****@*****.**');
     $this->hydrateToLdap($this->objectToLdap)->shouldHaveKeyWithValue('enabled', false);
 }