public function setUp()
 {
     if (App::getEnv() !== 'testing-ericsson') {
         $this->markTestSkipped();
     }
     $this->simMapper = SimMapper::getInstance();
 }
 public function setUp()
 {
     if (App::getEnv() !== 'testing-ericsson') {
         $this->markTestSkipped();
     }
     $this->simMapper = SimMapper::getInstance();
     // Hack: Override the logged user organization
     $org = new \Application\Model\Organization\OrgMasterModel();
     $org->setId(self::ORG_ID);
     \App::getOrgUserLogged($org);
     $this->_user = $this->_createAuthUser(array('userName' => 'SimUserTest', 'organizationId' => self::ORG_ID));
 }
 protected function _mapData($data)
 {
     $data = SimMapper::getInstance()->mapEricssonModelToModel($data);
     return new SimModel($data);
 }
 public function setUp()
 {
     \App::cache()->clean();
     $this->simMapper = SimMapper::getInstance();
     $this->_user = $this->_createAuthUser(array('userName' => 'SimUserTest', 'organizationId' => Application\Model\Organization\OrgServiceProviderModel::ORG_TYPE . '-' . 'sp1 (non-commercial)111111111111'));
 }
 /**
  *
  * @param  string                      $id
  * @return \Application\Model\SimModel | null
  */
 public static function find($id)
 {
     $sim = SimMapper::getInstance()->findOneById($id, \App::getOrgUserLogged()->getId());
     return $sim;
 }
 public function setUp()
 {
     $this->simMapper = SimMapper::getInstance();
     $this->_user = $this->_createAuthUser(array('userName' => 'SimUserTest', 'organizationId' => self::CUSTOMER_ORG_ID));
 }
 /**
  * @param $state
  * @param $data array|App_FilterList
  * @return void
  */
 public function changeLifeCycleStateSync($oldState, $newState, $simId)
 {
     if (!in_array($oldState, LifeCycleModel::getStatuses()) || !in_array($newState, LifeCycleModel::getStatuses())) {
         throw new InvalidArgumentException("Invalid state");
     }
     $mapper = SimMapper::getInstance();
     if ($newState === LifeCycleModel::STATUS_RESTORE) {
         $result = $mapper->restoreSuspendedLifeCycleStateSync($simId);
     } else {
         //find operation cost
         $cost = $mapper->getLifeCycleStateCost($oldState, $newState, $simId);
         $result = $mapper->changeLifeCycleStateSync($oldState, $newState, $simId, $cost);
     }
     \App::audit('Changed life cycle status on sims to ' . $newState . '. Handler: ' . $result, null);
     return $result;
 }