public function testGetLocale() { $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); \Zend_Locale_Data::removeCache(); $this->assertNull(\Zend_Locale_Data::getCache()); $model = $objectManager->create('Magento\\Framework\\Locale\\ResolverInterface', ['locale' => 'some_locale']); $this->assertInstanceOf('Zend_Locale', $model->getLocale()); $this->assertInstanceOf('Zend_Cache_Core', \Zend_Locale_Data::getCache()); }
public function setup() { if (Zend_Registry::isRegistered('Zend_Locale')) { $registry = Zend_Registry::getInstance(); unset($registry['Zend_Locale']); } Zend_Locale_Data::removeCache(); $this->_locale = setlocale(LC_ALL, 0); setlocale(LC_ALL, 'de'); }
/** * teardown / cleanup */ public function tearDown() { // if the setlocale option is enabled, then don't change the setlocale below if (defined('TESTS_ZEND_LOCALE_FORMAT_SETLOCALE') && TESTS_ZEND_LOCALE_FORMAT_SETLOCALE === false) { // I'm anticipating possible platform inconsistencies, so I'm leaving some debug comments for now. //echo '<<<', setlocale(LC_NUMERIC, '0'); // show locale before changing setlocale(LC_ALL, 'C'); // attempt to restore global setting i.e. test teardown //echo '>>>', setlocale(LC_NUMERIC, '0'); // show locale after changing //echo "\n"; } else { if (defined('TESTS_ZEND_LOCALE_FORMAT_SETLOCALE')) { setlocale(LC_ALL, TESTS_ZEND_LOCALE_FORMAT_SETLOCALE); } } Zend_Locale_Data::removeCache(); }
/** * Removes any set cache * * @return void */ public static function removeCache() { Zend_Locale_Data::removeCache(); }
/** * Removes any set cache * * @return void */ public static function removeCache() { require_once 'Zend/Locale/Data.php'; Zend_Locale_Data::removeCache(); }
/** * Removes any set cache * * @return void */ public static function removeCache() { require_once PHP_LIBRARY_PATH . 'Zend/Locale/Data.php'; Zend_Locale_Data::removeCache(); }
/** * Removes any set cache * * @return void */ public static function removeCache() { //$1 'Zend/Locale/Data.php'; Zend_Locale_Data::removeCache(); }