public function testUpgradeTariffTemplate()
 {
     $oldTariffTemplate = $this->_templateService->load($this->_oldTariffTemplate['_id']);
     //Initialize db for use in included script
     $db = $this->_db;
     include App::getApplicationPath() . '/../scripts/updates/02.00rev20130312.php';
     /**
      * @var \Application\Model\TemplateModel $upgradedTariffTemplate
      */
     $upgradedTariffTemplate = $this->_templateService->load($this->_oldTariffTemplate['_id']);
     $this->assertNotNull($upgradedTariffTemplate->name);
     $this->assertNotNull($upgradedTariffTemplate->organizationId);
     $this->assertNotNull($upgradedTariffTemplate->type);
     $this->assertNotNull($upgradedTariffTemplate->id);
     $this->assertNotNull($upgradedTariffTemplate->modified);
     $this->assertNotNull($upgradedTariffTemplate->zonePlanId);
     $this->assertNotNull($upgradedTariffTemplate->zonePlan);
     $zonePlan = $upgradedTariffTemplate->zonePlan;
     $zoneGroup = $zonePlan['zoneGroups'][0];
     $this->assertNotNull($zoneGroup['id']);
     $this->assertNotNull($zoneGroup['name']);
     $this->assertNotNull($zoneGroup['zones']);
     $this->assertEquals(1, count($zoneGroup['zones']));
     $this->assertEquals($zoneGroup['zones'][0], 2);
     $termVoice = current($upgradedTariffTemplate->termVoice);
     $this->assertNull($termVoice['zoneId']);
     $this->assertNotNull($termVoice['zoneGroupId']);
     $this->assertNotNull($termVoice['zoneGroupName']);
 }
示例#2
0
 /**
  * Return full application path
  * @return string
  */
 public static function getFileCachePath()
 {
     return App::getApplicationPath() . '/../data/cache/';
 }