Beispiel #1
0
 /**
  * @param array $attributes
  */
 public function add(array $attributes)
 {
     if (ArrayHelper::isAssoc($attributes)) {
         $this->attributes->setData($attributes);
     } else {
         foreach ($attributes as $attribute) {
             if (is_array($attribute)) {
                 $this->attributes->setData($attribute);
             } else {
                 $this->attributes->set($attribute, $attribute);
             }
         }
     }
 }
 /**
  * Check if given array is not an associative array
  */
 public function testIsNotAssoc()
 {
     $array = ['test', 'test'];
     $this->assertFalse(ArrayHelper::isAssoc($array));
 }