Fuente: https://github.com/chamilo/chamilo-lms/releases/download/v1.11.40/chamilo-1.11.40.zip sha256: 1cf4bf2cc7bae1ef1a1eff643235db1d552f78ddf4b6dd1e2d2dac9868679439 Snapshot independiente (rama huerfana); diffable vs 1.11.38. vendor incluido.
38 lines
1.2 KiB
PHP
38 lines
1.2 KiB
PHP
<?php
|
|
|
|
/*
|
|
* This file is part of Twig.
|
|
*
|
|
* (c) Fabien Potencier
|
|
*
|
|
* For the full copyright and license information, please view the LICENSE
|
|
* file that was distributed with this source code.
|
|
*/
|
|
|
|
class Twig_Tests_Extension_IntlTest extends \PHPUnit\Framework\TestCase
|
|
{
|
|
/**
|
|
* @requires extension intl
|
|
* @requires PHP 5.5
|
|
*/
|
|
public function testLocalizedDateFilterWithDateTimeZone()
|
|
{
|
|
class_exists('Twig_Extensions_Extension_Intl');
|
|
$env = $this->getMockBuilder('Twig_Environment')->disableOriginalConstructor()->getMock();
|
|
$date = twig_localized_date_filter($env, new DateTime('2015-01-01T00:00:00', new DateTimeZone('UTC')), 'short', 'long', 'en', '+01:00');
|
|
$this->assertEquals('1/1/15 1:00:00 AM GMT+01:00', $date);
|
|
}
|
|
|
|
/**
|
|
* @requires extension intl
|
|
* @requires PHP 5.5
|
|
*/
|
|
public function testLocalizedDateFilterWithDateTimeZoneZ()
|
|
{
|
|
class_exists('Twig_Extensions_Extension_Intl');
|
|
$env = $this->getMockBuilder('Twig_Environment')->disableOriginalConstructor()->getMock();
|
|
$date = twig_localized_date_filter($env, new DateTime('2017-11-19T00:00:00Z'), 'short', 'long', 'fr', 'Z');
|
|
$this->assertEquals('19/11/2017 00:00:00 UTC', $date);
|
|
}
|
|
}
|