/** * Removes duplicate values from a LDAP attribute * * @param string $attribName * @return void */ public function removeDuplicatesFromAttribute($attribName) { Zend_Ldap_Attribute::removeDuplicatesFromAttribute($this->_currentData, $attribName); }
public function testRemoveDuplicates() { $data = array('strings1' => array('value1', 'value2', 'value2', 'value3'), 'strings2' => array('value1', 'value2', 'value3', 'value4'), 'boolean1' => array('TRUE', 'TRUE', 'TRUE', 'TRUE'), 'boolean2' => array('TRUE', 'FALSE', 'TRUE', 'FALSE')); $expected = array('strings1' => array('value1', 'value2', 'value3'), 'strings2' => array('value1', 'value2', 'value3', 'value4'), 'boolean1' => array('TRUE'), 'boolean2' => array('TRUE', 'FALSE')); Zend_Ldap_Attribute::removeDuplicatesFromAttribute($data, 'strings1'); Zend_Ldap_Attribute::removeDuplicatesFromAttribute($data, 'strings2'); Zend_Ldap_Attribute::removeDuplicatesFromAttribute($data, 'boolean1'); Zend_Ldap_Attribute::removeDuplicatesFromAttribute($data, 'boolean2'); $this->assertEquals($expected, $data); }