当前位置: 首页>>代码示例>>PHP>>正文


PHP Util\IntlTestHelper类代码示例

本文整理汇总了PHP中Symfony\Component\Intl\Util\IntlTestHelper的典型用法代码示例。如果您正苦于以下问题:PHP IntlTestHelper类的具体用法?PHP IntlTestHelper怎么用?PHP IntlTestHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了IntlTestHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setUp

 protected function setUp()
 {
     // we test against different locales, so we need the full
     // implementation
     IntlTestHelper::requireFullIntl($this);
     parent::setUp();
 }
开发者ID:xingshanghe,项目名称:symfony,代码行数:7,代码来源:MoneyTypeTest.php

示例2: testWriteResourceBundle

 public function testWriteResourceBundle()
 {
     IntlTestHelper::requireFullIntl($this);
     $bundle = new \ResourceBundle('rb', __DIR__ . '/Fixtures', false);
     $this->writer->write($this->directory, 'en', $bundle);
     $this->assertFileEquals(__DIR__ . '/Fixtures/rb.php', $this->directory . '/en.php');
 }
开发者ID:tahermarkos,项目名称:Transport,代码行数:7,代码来源:PhpBundleWriterTest.php

示例3: testValidCurrenciesWithCountrySpecificLocale

 /**
  * @dataProvider getValidCurrencies
  **/
 public function testValidCurrenciesWithCountrySpecificLocale($currency)
 {
     IntlTestHelper::requireFullIntl($this);
     \Locale::setDefault('en_GB');
     $this->validator->validate($currency, new Currency());
     $this->assertNoViolation();
 }
开发者ID:Dren-x,项目名称:mobit,代码行数:10,代码来源:CurrencyValidatorTest.php

示例4: setUp

 protected function setUp()
 {
     parent::setUp();
     // we test against "de_DE", so we need the full implementation
     IntlTestHelper::requireFullIntl($this);
     \Locale::setDefault('de_DE');
 }
开发者ID:xingshanghe,项目名称:symfony,代码行数:7,代码来源:NumberTypeTest.php

示例5: setUp

 protected function setUp()
 {
     IntlTestHelper::requireFullIntl($this);
     $this->context = $this->getMock('Symfony\\Component\\Validator\\ExecutionContext', array(), array(), '', false);
     $this->validator = new CurrencyValidator();
     $this->validator->initialize($this->context);
 }
开发者ID:NivalM,项目名称:VacantesJannaMotors,代码行数:7,代码来源:CurrencyValidatorTest.php

示例6: testReverseTransformWithPrecision

 public function testReverseTransformWithPrecision()
 {
     // Since we test against "de_AT", we need the full implementation
     IntlTestHelper::requireFullIntl($this);
     \Locale::setDefault('de_AT');
     $transformer = new PercentToLocalizedStringTransformer(2);
     $this->assertEquals(0.1234, $transformer->reverseTransform('12,34'));
 }
开发者ID:d3ancole1995,项目名称:symfony,代码行数:8,代码来源:PercentToLocalizedStringTransformerTest.php

示例7: setUp

 protected function setUp()
 {
     parent::setUp();
     // we test against "de_AT", so we need the full implementation
     IntlTestHelper::requireFullIntl($this);
     \Locale::setDefault('de_AT');
     $this->defaultTimezone = date_default_timezone_get();
 }
开发者ID:VincentMardon,项目名称:Links_list,代码行数:8,代码来源:DateTypeTest.php

示例8: getDateFormatter

 protected function getDateFormatter($locale, $datetype, $timetype, $timezone = null, $calendar = IntlDateFormatter::GREGORIAN, $pattern = null)
 {
     IntlTestHelper::requireFullIntl($this, '55.1');
     if (!($formatter = new \IntlDateFormatter($locale, $datetype, $timetype, $timezone, $calendar, $pattern))) {
         throw new \InvalidArgumentException(intl_get_error_message());
     }
     return $formatter;
 }
开发者ID:yceruto,项目名称:symfony,代码行数:8,代码来源:IntlDateFormatterTest.php

示例9: testReverseTransform

 public function testReverseTransform()
 {
     // Since we test against "de_AT", we need the full implementation
     IntlTestHelper::requireFullIntl($this, false);
     \Locale::setDefault('de_AT');
     $transformer = new MoneyToLocalizedStringTransformer(null, null, null, 100);
     $this->assertEquals(123, $transformer->reverseTransform('1,23'));
 }
开发者ID:yceruto,项目名称:symfony,代码行数:8,代码来源:MoneyToLocalizedStringTransformerTest.php

示例10: testValidateUsingCountrySpecificLocale

 public function testValidateUsingCountrySpecificLocale()
 {
     IntlTestHelper::requireFullIntl($this);
     \Locale::setDefault('fr_FR');
     $existingLanguage = 'en';
     $this->validator->validate($existingLanguage, new Language(array('message' => 'aMessage')));
     $this->assertNoViolation();
 }
开发者ID:Dren-x,项目名称:mobit,代码行数:8,代码来源:LanguageValidatorTest.php

示例11: setUp

 protected function setUp()
 {
     parent::setUp();
     // Since we test against "de_AT", we need the full implementation
     IntlTestHelper::requireFullIntl($this);
     \Locale::setDefault('de_AT');
     $this->dateTime = new \DateTime('2010-02-03 04:05:06 UTC');
     $this->dateTimeWithoutSeconds = new \DateTime('2010-02-03 04:05:00 UTC');
 }
开发者ID:Ener-Getick,项目名称:symfony,代码行数:9,代码来源:DateTimeToLocalizedStringTransformerTest.php

示例12: testValidateUsingCountrySpecificLocale

 public function testValidateUsingCountrySpecificLocale()
 {
     // in order to test with "en_GB"
     IntlTestHelper::requireFullIntl($this);
     \Locale::setDefault('en_GB');
     $existingCountry = 'GB';
     $this->validator->validate($existingCountry, new Country());
     $this->assertNoViolation();
 }
开发者ID:ayoah,项目名称:symfony,代码行数:9,代码来源:CountryValidatorTest.php

示例13: testValidateUsingCountrySpecificLocale

 public function testValidateUsingCountrySpecificLocale()
 {
     // in order to test with "en_GB"
     IntlTestHelper::requireFullIntl($this);
     \Locale::setDefault('en_GB');
     $existingCountry = 'GB';
     $this->context->expects($this->never())->method('addViolation');
     $this->validator->validate($existingCountry, new Country());
 }
开发者ID:brookinsconsulting,项目名称:ezecosystem,代码行数:9,代码来源:CountryValidatorTest.php

示例14: testBuildForm

 /**
  * @dataProvider buildFormProvider
  *
  * @param array  $configData
  * @param string $defaultLang
  * @param array  $choicesKeysExpected
  */
 public function testBuildForm(array $configData, $defaultLang, array $choicesKeysExpected)
 {
     IntlTestHelper::requireIntl($this);
     \Locale::setDefault($defaultLang);
     $this->cmMock->expects($this->at(0))->method('get')->with($this->equalTo(LanguageType::CONFIG_KEY), $this->equalTo(true))->will($this->returnValue($defaultLang));
     $this->cmMock->expects($this->at(1))->method('get')->with($this->equalTo(TranslationStatusInterface::CONFIG_KEY))->will($this->returnValue($configData));
     $form = $this->factory->create($this->formType);
     $choices = $form->getConfig()->getOption('choices');
     $this->assertEquals($choicesKeysExpected, array_keys($choices));
 }
开发者ID:Maksold,项目名称:platform,代码行数:17,代码来源:LanguageTypeTest.php

示例15: testGetLocaleReturnsDefaultLocaleIfNotSet

 public function testGetLocaleReturnsDefaultLocaleIfNotSet()
 {
     // in order to test with "pt_BR"
     IntlTestHelper::requireFullIntl($this);
     $translator = new IdentityTranslator();
     \Locale::setDefault('en');
     $this->assertEquals('en', $translator->getLocale());
     \Locale::setDefault('pt_BR');
     $this->assertEquals('pt_BR', $translator->getLocale());
 }
开发者ID:BusinessCookies,项目名称:CoffeeMachineProject,代码行数:10,代码来源:IdentityTranslatorTest.php


注:本文中的Symfony\Component\Intl\Util\IntlTestHelper类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。