protected function _createTariffPlanServices()
 {
     $tariffPlanServices = new Model\TariffPlanServicesModel($this->_servicesTariffPlanData);
     $this->_tfservMapper->insert($tariffPlanServices);
     $this->assertNotNull($tariffPlanServices->getId());
     $newTariffPlanServices = $this->_tfservMapper->findOneById($tariffPlanServices->getId());
     $this->assertNotNull($newTariffPlanServices, "TariffPlan Service does not exist");
     $this->_checkSavedData($this->_servicesTariffPlanData, $newTariffPlanServices, "TariffPlanServices");
     return $tariffPlanServices->getId();
 }
 /**
  * Get mapper instance
  *
  * @return ProtoAbstractMapper|MongoAbstractMapper
  */
 public function getMapper($type = null)
 {
     if (!$type) {
         return parent::getMapper();
     }
     // Call mapper static method
     switch (strtolower($type)) {
         case self::TYPE_LIFECYCLE:
             return \Application\Model\Mapper\TariffPlanLifeCycleMapper::getInstance();
             break;
         case self::TYPE_SERVICES:
             return \Application\Model\Mapper\TariffPlanServicesMapper::getInstance();
             break;
         default:
             throw new AppEx\InvalidArgumentException("Invalid Type given");
     }
 }
 public function testTariffPlanServicesDelete()
 {
     $data = $this->_mapper->delete(1);
     $this->assertTrue($data);
 }
 public function setUp()
 {
     $this->TariffPlanServicesMapper = TariffPlanServicesMapper::getInstance();
     $this->_user = $this->_createAuthUser(array('userName' => 'TariffPlanUserTest', 'organizationId' => self::PROVIDER_COMMERCIAL_ORG_ID));
     $this->testArray = array('name' => 'tarif plan 01', 'description' => 'tarif plan 01', 'currencyId' => 978, 'data' => array('defaultData' => array('zones' => array(array('id' => 1, 'name' => 'Zone1')), 'destinations' => array(array('id' => 1, 'name' => 'Destination1')), 't6N' => 4, 't6Q' => 4, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), 'data' => array(array('zones' => array(array('id' => 1, 'name' => 'Zone1')), 'destinations' => array(array('id' => 1, 'name' => 'Destination1')), 'n1' => 4, 'n2' => 4, 'n3' => 4, 'n4' => 4, 'n5' => 4, 'q1' => 4, 't2N' => 4, 't2Q' => 4, 't4N' => 4, 't4Q' => 4, 't6N' => 4, 't6Q' => 4, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0)), 'defaultOrigVoice' => array('zones' => array(array('id' => 1, 'name' => 'Zone1')), 'destinations' => array(array('id' => 1, 'name' => 'Destination1')), 't6N' => 1, 't6Q' => 1, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), 'origVoice' => array(array('zones' => array(array('id' => 1, 'name' => 'Zone1')), 'destinations' => array(array('id' => 1, 'name' => 'Destination1')), 'n1' => 1, 'n2' => 1, 'n3' => 1, 'n4' => 1, 'n5' => 1, 'q1' => 1, 't2N' => 1, 't2Q' => 1, 't4N' => 1, 't4Q' => 1, 't6N' => 1, 't6Q' => 1, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0)), 'defaultTermVoice' => array('zones' => array(array('id' => 1, 'name' => 'Zone1')), 'destinations' => array(array('id' => 1, 'name' => 'Destination1')), 't6N' => 2, 't6Q' => 2, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), 'termVoice' => array(array('zones' => array(array('id' => 1, 'name' => 'Zone1')), 'destinations' => array(array('id' => 1, 'name' => 'Destination1')), 'n1' => 2, 'n2' => 2, 'n3' => 2, 'n4' => 2, 'n5' => 2, 'q1' => 2, 't2N' => 2, 't2Q' => 2, 't4N' => 2, 't4Q' => 2, 't6N' => 2, 't6Q' => 2, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0)), 'defaultSms' => array('zones' => array(array('id' => 1, 'name' => 'Zone1')), 'destinations' => array(array('id' => 1, 'name' => 'Destination1')), 't6N' => 3, 't6Q' => 3, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), 'sms' => array(array('zones' => array(array('id' => 1, 'name' => 'Zone1')), 'destinations' => array(array('id' => 1, 'name' => 'Destination1')), 'n1' => 3, 'n2' => 3, 'n3' => 3, 'n4' => 3, 'n5' => 3, 'q1' => 3, 't2N' => 3, 't2Q' => 3, 't4N' => 3, 't4Q' => 3, 't6N' => 3, 't6Q' => 3, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0)), 'poolDefaultData' => array('zones' => array(array('id' => 1, 'name' => 'Zone1')), 'destinations' => array(array('id' => 1, 'name' => 'Destination1')), 't6N' => 8, 't6Q' => 8, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), 'poolData' => array(array('zones' => array(array('id' => 1, 'name' => 'Zone1')), 'destinations' => array(array('id' => 1, 'name' => 'Destination1')), 'n1' => 8, 'n2' => 8, 'n3' => 8, 'n4' => 8, 'n5' => 8, 'q1' => 8, 't2N' => 8, 't2Q' => 8, 't4N' => 8, 't4Q' => 8, 't6N' => 8, 't6Q' => 8, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0)), 'poolDefaultOrigVoice' => array('zones' => array(array('id' => 1, 'name' => 'Zone1')), 'destinations' => array(array('id' => 1, 'name' => 'Destination1')), 't6N' => 5, 't6Q' => 5, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), 'poolOrigVoice' => array(array('zones' => array(array('id' => 1, 'name' => 'Zone1')), 'destinations' => array(array('id' => 1, 'name' => 'Destination1')), 'n1' => 5, 'n2' => 5, 'n3' => 5, 'n4' => 5, 'n5' => 5, 'q1' => 5, 't2N' => 5, 't2Q' => 5, 't4N' => 5, 't4Q' => 5, 't6N' => 5, 't6Q' => 5, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0)), 'poolDefaultTermVoice' => array('zones' => array(array('id' => 1, 'name' => 'Zone1')), 'destinations' => array(array('id' => 1, 'name' => 'Destination1')), 't6N' => 6, 't6Q' => 6, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), 'poolTermVoice' => array(array('zones' => array(array('id' => 1, 'name' => 'Zone1')), 'destinations' => array(array('id' => 1, 'name' => 'Destination1')), 'n1' => 6, 'n2' => 6, 'n3' => 6, 'n4' => 6, 'n5' => 6, 'q1' => 6, 't2N' => 6, 't2Q' => 6, 't4N' => 6, 't4Q' => 6, 't6N' => 6, 't6Q' => 6, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0)), 'poolDefaultSms' => array('zones' => array(array('id' => 1, 'name' => 'Zone1')), 'destinations' => array(array('id' => 1, 'name' => 'Destination1')), 't6N' => 7, 't6Q' => 7, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0), 'poolSms' => array(array('zones' => array(array('id' => 1, 'name' => 'Zone1')), 'destinations' => array(array('id' => 1, 'name' => 'Destination1')), 'n1' => 7, 'n2' => 7, 'n3' => 7, 'n4' => 7, 'n5' => 7, 'q1' => 7, 't2N' => 7, 't2Q' => 7, 't4N' => 7, 't4Q' => 7, 't6N' => 7, 't6Q' => 7, 'prorrationThreshold' => 0, 'adjustmentThreshold' => 0))));
 }
 public function testTariffPlanLifeCycleDelete()
 {
     $data = $this->_mapper->delete(1);
     $this->assertTrue($data);
 }