aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/symfony/intl/Symfony/Component/Intl/Tests/DateFormatter/Verification/IntlDateFormatterTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/symfony/intl/Symfony/Component/Intl/Tests/DateFormatter/Verification/IntlDateFormatterTest.php')
-rw-r--r--vendor/symfony/intl/Symfony/Component/Intl/Tests/DateFormatter/Verification/IntlDateFormatterTest.php64
1 files changed, 64 insertions, 0 deletions
diff --git a/vendor/symfony/intl/Symfony/Component/Intl/Tests/DateFormatter/Verification/IntlDateFormatterTest.php b/vendor/symfony/intl/Symfony/Component/Intl/Tests/DateFormatter/Verification/IntlDateFormatterTest.php
new file mode 100644
index 00000000..7fbf854f
--- /dev/null
+++ b/vendor/symfony/intl/Symfony/Component/Intl/Tests/DateFormatter/Verification/IntlDateFormatterTest.php
@@ -0,0 +1,64 @@
1<?php
2
3/*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11
12namespace Symfony\Component\Intl\Tests\DateFormatter\Verification;
13
14use Symfony\Component\Intl\DateFormatter\IntlDateFormatter;
15use Symfony\Component\Intl\Tests\DateFormatter\AbstractIntlDateFormatterTest;
16use Symfony\Component\Intl\Util\IntlTestHelper;
17
18/**
19 * Verifies that {@link AbstractIntlDateFormatterTest} matches the behavior of
20 * the {@link \IntlDateFormatter} class in a specific version of ICU.
21 *
22 * @author Bernhard Schussek <bschussek@gmail.com>
23 */
24class IntlDateFormatterTest extends AbstractIntlDateFormatterTest
25{
26 protected function setUp()
27 {
28 IntlTestHelper::requireFullIntl($this);
29
30 parent::setUp();
31 }
32
33 /**
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.
37 *
38 * @runInSeparateProcess
39 */
40 public function testFormatWithTimezoneFromEnvironmentVariable()
41 {
42 parent::testFormatWithTimezoneFromEnvironmentVariable();
43 }
44
45 protected function getDateFormatter($locale, $datetype, $timetype, $timezone = null, $calendar = IntlDateFormatter::GREGORIAN, $pattern = null)
46 {
47 return new \IntlDateFormatter($locale, $datetype, $timetype, $timezone, $calendar, $pattern);
48 }
49
50 protected function getIntlErrorMessage()
51 {
52 return intl_get_error_message();
53 }
54
55 protected function getIntlErrorCode()
56 {
57 return intl_get_error_code();
58 }
59
60 protected function isIntlFailure($errorCode)
61 {
62 return intl_is_failure($errorCode);
63 }
64}