/** * test getCountryTranslationList * expected true */ public function testgetCountryTranslationList() { $value = new Zend_Locale(); $list = $value->getCountryTranslationList(); $this->assertTrue(is_array($list)); $list = $value->getCountryTranslationList('de'); $this->assertEquals("Vereinigte Staaten", $list['US']); }
<?php require_once dirname(__FILE__) . '/../../common.php'; // ----------------------------------------------------------------------------- // Get geographical information, based on current IP try { $client = new Zend_Http_Client(); $client->setUri('http://ipLocationTools.com/ip_query.php?output=json'); $response = $client->request(); if (200 === $response->getStatus()) { $geoIp = Zend_Json::decode($response->getBody()); if (isset($geoIp['City']) && strlen($geoIp['City']) > 0) { $city = $geoIp['City']; } if (isset($geoIp['CountryCode']) && strlen($geoIp['CountryCode']) > 0) { $countryCode = $geoIp['CountryCode']; $countries = Zend_Locale::getCountryTranslationList(LOCALE); if (isset($countries[$countryCode])) { $country = $countries[$countryCode]; } } } } catch (Zend_Http_Client_Exception $e) { } // ----------------------------------------------------------------------------- // Generate document $date = new Zend_Date(); $date->setLocale(LOCALE); $phpLiveDocx = new Tis_Service_LiveDocx_MailMerge(USERNAME, PASSWORD); $phpLiveDocx->setLocalTemplate('template.docx'); $phpLiveDocx->assign('software', 'Magic Graphical Compression Suite v1.9'); $phpLiveDocx->assign('licensee', 'Henry Döner-Meyer');
/** * test getCountryTranslationList * expected true */ public function testgetCountryTranslationList() { $value = new Zend_Locale(); $list = $value->getCountryTranslationList(); $this->assertTrue(is_array($list), 'Region List not returned'); $list = $value->getCountryTranslationList('de'); $this->assertTrue(is_array($list), 'Region List not returned'); }
/** * Get the countries list generated using Zend_Locale * * @return array $key=>$value */ public function getCountryOptionList() { return Zend_Locale::getCountryTranslationList(); }