]> git.immae.eu Git - github/wallabag/wallabag.git/blob - vendor/symfony/intl/Symfony/Component/Intl/Tests/DateFormatter/Verification/IntlDateFormatterTest.php
twig implementation
[github/wallabag/wallabag.git] / vendor / symfony / intl / Symfony / Component / Intl / Tests / DateFormatter / Verification / IntlDateFormatterTest.php
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
12 namespace Symfony\Component\Intl\Tests\DateFormatter\Verification;
13
14 use Symfony\Component\Intl\DateFormatter\IntlDateFormatter;
15 use Symfony\Component\Intl\Tests\DateFormatter\AbstractIntlDateFormatterTest;
16 use 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 */
24 class 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 }