Exemplo n.º 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);
             }
         }
     }
 }
Exemplo n.º 2
0
 /**
  * Check if given array is not an associative array
  */
 public function testIsNotAssoc()
 {
     $array = ['test', 'test'];
     $this->assertFalse(ArrayHelper::isAssoc($array));
 }