private function saveAttributeSet()
 {
     if ($this->attributeSetObj->getId()) {
         return array('result' => true, 'obj' => $this->attributeSetObj);
     }
     $this->attributeSetObj->setEntityTypeId($this->entityTypeId)->setAttributeSetName($this->setName);
     try {
         $this->attributeSetObj->validate();
         $this->attributeSetObj->save();
         $this->attributeSetObj->initFromSkeleton($this->skeletonId)->save();
     } catch (Exception $e) {
         return array('result' => false, 'error' => $e->getMessage());
     }
     return array('result' => true, 'obj' => $this->attributeSetObj);
 }
Beispiel #2
0
 public function testValidateWithNonexistentValidName()
 {
     $this->_model->getResource()->expects($this->any())->method('validate')->will($this->returnValue(true));
     $this->_model->setAttributeSetName('nonexistent_name');
     $this->assertTrue($this->_model->validate());
 }