示例#1
0
文件: Node.php 项目: GeeH/zend-ldap
 /**
  * Removes duplicate values from a LDAP attribute
  *
  * @param  string $attribName
  * @return void
  */
 public function removeDuplicatesFromAttribute($attribName)
 {
     Attribute::removeDuplicatesFromAttribute($this->currentData, $attribName);
 }
示例#2
0
 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'));
     Attribute::removeDuplicatesFromAttribute($data, 'strings1');
     Attribute::removeDuplicatesFromAttribute($data, 'strings2');
     Attribute::removeDuplicatesFromAttribute($data, 'boolean1');
     Attribute::removeDuplicatesFromAttribute($data, 'boolean2');
     $this->assertEquals($expected, $data);
 }