本文整理汇总了PHP中Symfony\Component\Intl\Util\IntlTestHelper::requireFullIntl方法的典型用法代码示例。如果您正苦于以下问题:PHP IntlTestHelper::requireFullIntl方法的具体用法?PHP IntlTestHelper::requireFullIntl怎么用?PHP IntlTestHelper::requireFullIntl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\Intl\Util\IntlTestHelper
的用法示例。
在下文中一共展示了IntlTestHelper::requireFullIntl方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例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');
}
示例3: setUp
protected function setUp()
{
// we test against different locales, so we need the full
// implementation
IntlTestHelper::requireFullIntl($this);
parent::setUp();
}
示例4: testValidCurrenciesWithCountrySpecificLocale
/**
* @dataProvider getValidCurrencies
**/
public function testValidCurrenciesWithCountrySpecificLocale($currency)
{
IntlTestHelper::requireFullIntl($this);
\Locale::setDefault('en_GB');
$this->validator->validate($currency, new Currency());
$this->assertNoViolation();
}
示例5: setUp
protected function setUp()
{
parent::setUp();
// we test against "de_DE", so we need the full implementation
IntlTestHelper::requireFullIntl($this);
\Locale::setDefault('de_DE');
}
示例6: 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();
}
示例7: 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'));
}
示例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;
}
示例9: testValidateUsingCountrySpecificLocale
public function testValidateUsingCountrySpecificLocale()
{
IntlTestHelper::requireFullIntl($this);
\Locale::setDefault('fr_FR');
$existingLanguage = 'en';
$this->validator->validate($existingLanguage, new Language(array('message' => 'aMessage')));
$this->assertNoViolation();
}
示例10: 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'));
}
示例11: 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();
}
示例12: 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());
}
示例13: 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');
}
示例14: 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());
}
示例15: testReverseTransformWithGrouping
public function testReverseTransformWithGrouping()
{
// Since we test against "de_AT", we need the full implementation
IntlTestHelper::requireFullIntl($this);
\Locale::setDefault('de_AT');
$transformer = new IntegerToLocalizedStringTransformer(null, true);
$this->assertEquals(1234, $transformer->reverseTransform('1.234,5'));
$this->assertEquals(12345, $transformer->reverseTransform('12.345,912'));
$this->assertEquals(1234, $transformer->reverseTransform('1234,5'));
$this->assertEquals(12345, $transformer->reverseTransform('12345,912'));
}