4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\Intl\Tests\DateFormatter\Verification
;
14 use Symfony\Component\Intl\DateFormatter\IntlDateFormatter
;
15 use Symfony\Component\Intl\Tests\DateFormatter\AbstractIntlDateFormatterTest
;
16 use Symfony\Component\Intl\Util\IntlTestHelper
;
19 * Verifies that {@link AbstractIntlDateFormatterTest} matches the behavior of
20 * the {@link \IntlDateFormatter} class in a specific version of ICU.
22 * @author Bernhard Schussek <bschussek@gmail.com>
24 class IntlDateFormatterTest
extends AbstractIntlDateFormatterTest
26 protected function setUp()
28 IntlTestHelper
::requireFullIntl($this);
34 * It seems IntlDateFormatter caches the timezone id when not explicitly set via constructor or by the
35 * setTimeZoneId() method. Since testFormatWithDefaultTimezoneIntl() runs using the default environment
36 * time zone, this test would use it too if not running in a separated process.
38 * @runInSeparateProcess
40 public function testFormatWithTimezoneFromEnvironmentVariable()
42 parent
::testFormatWithTimezoneFromEnvironmentVariable();
45 protected function getDateFormatter($locale, $datetype, $timetype, $timezone = null, $calendar = IntlDateFormatter
::GREGORIAN
, $pattern = null)
47 return new \
IntlDateFormatter($locale, $datetype, $timetype, $timezone, $calendar, $pattern);
50 protected function getIntlErrorMessage()
52 return intl_get_error_message();
55 protected function getIntlErrorCode()
57 return intl_get_error_code();
60 protected function isIntlFailure($errorCode)
62 return intl_is_failure($errorCode);