Exemplo n.º 1
0
 public function testCreateAttributes()
 {
     foreach ($this->dataAttr() as $values) {
         $attr = new EavAttribute();
         $attr->attributes = $values;
         $attr->save();
     }
     $this->assertEquals(EavAttribute::find()->count(), 3);
     $k = 0;
     foreach ($this->dataAttr() as $values) {
         $k++;
         foreach ($values as $key => $value) {
             $this->assertEquals(EavAttribute::findOne(['id' => $k])->{$key}, $value);
         }
     }
 }
Exemplo n.º 2
0
 public function canGetProperty($name, $checkVars = true)
 {
     return EavAttribute::find()->where(['name' => $name])->exists();
 }