public function testValidateServicePackNotExists()
 {
     $servicePack = new ServicePackModel($this->_data);
     ServicePackMapper::getInstance()->insert($servicePack);
     $this->_servicePackIdToDelete = $servicePack->getId();
     $result = $this->_validator->isValid($servicePack->getId());
     $this->assertTrue($result);
 }
 protected function _addCustomerToServicePack()
 {
     $spId = $this->_publishServicePack();
     $this->assertTrue($this->_spMapper->addCustomer($spId, Model\Organization\OrgCustomerModel::ORG_TYPE . '-' . self::CUSTOMER_ID));
     $sp = $this->_spMapper->findOneById($spId);
     $this->assertEquals(1, $sp->getCustomerCount());
     $this->_addUser(self::CUSTOMER_ID, Model\Organization\OrgCustomerModel::ORG_TYPE);
     $list = $this->_spMapper->findAll();
     $this->assertNotNull($list);
     $this->assertGreaterThanOrEqual(1, $list->getCount());
     $this->assertGreaterThanOrEqual(1, count($list->getItems()));
 }
 public function delete($id)
 {
     if (!$id instanceof CommercialGroupModel) {
         $item = $this->findOneById($id);
     } else {
         $item = $id;
     }
     ServicePackMapper::getInstance()->getCache()->remove($item->servicePackId);
     return parent::delete($id);
 }