當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。