public function setUp()
 {
     $this->_sim = new SimModel();
     $this->_service = StockService::getInstance();
     $this->_user = new Application\Model\UserModel(array('userName' => 'StockIntUserTest', 'organizationId' => 'provider-sp1 (non-commercial)111111111111'));
     $this->_user->save();
     self::initAuthByUser($this->_user);
 }
 /**
  * Deletes the given user
  */
 public function deleteAction()
 {
     // Try to load the sim
     $id = $this->getRequest()->getParam('id');
     //TODO: We must use a load from stockService but there isn't service on E/// yet.
     $sim = new SimModel(array('icc' => $id));
     if (empty($sim)) {
         throw new \Application\Exceptions\NotFoundException('Sim ' . $id . ' not found', 404);
     }
     // Check permissions
     // TODO: We must check permision when we have a complete sim. See todo above.
     $this->_helper->allowed('preinventory_delete_sim', $sim);
     // Perform the delete
     try {
         $this->_stockSrv->delete($sim);
     } catch (Exception $e) {
         throw new InvalidArgumentException($e->getMessage(), null, $e);
     }
     $this->view->data = true;
 }
 public function init()
 {
     $this->_stockSrv = \Application\Service\StockService::getInstance();
     $this->_simSrv = SimService::getInstance();
 }
 public function setUp()
 {
     $this->_sim = new SimModel();
     $this->_service = StockService::getInstance();
     self::initAuthUser(self::PROVIDER_ENABLER_USER_ID);
 }