twig implementation

This commit is contained in:
Nicolas Lœuillet
2013-08-03 19:26:54 +02:00
parent 2b840e0cfb
commit 4f5b44bd3b
1418 changed files with 108207 additions and 1586 deletions

View File

@ -0,0 +1,41 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Intl\Tests\Globals;
/**
* Test case for intl function implementations.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
abstract class AbstractIntlGlobalsTest extends \PHPUnit_Framework_TestCase
{
public function errorNameProvider()
{
return array (
array(-129, '[BOGUS UErrorCode]'),
array(0, 'U_ZERO_ERROR'),
array(1, 'U_ILLEGAL_ARGUMENT_ERROR'),
array(9, 'U_PARSE_ERROR'),
array(129, '[BOGUS UErrorCode]'),
);
}
/**
* @dataProvider errorNameProvider
*/
public function testGetErrorName($errorCode, $errorName)
{
$this->assertSame($errorName, $this->getIntlErrorName($errorCode));
}
abstract protected function getIntlErrorName($errorCode);
}

View File

@ -0,0 +1,22 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Intl\Tests\Globals;
use Symfony\Component\Intl\Globals\IntlGlobals;
class IntlGlobalsTest extends AbstractIntlGlobalsTest
{
protected function getIntlErrorName($errorCode)
{
return IntlGlobals::getErrorName($errorCode);
}
}

View File

@ -0,0 +1,36 @@
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Component\Intl\Tests\Globals\Verification;
use Symfony\Component\Intl\Tests\Globals\AbstractIntlGlobalsTest;
use Symfony\Component\Intl\Util\IntlTestHelper;
/**
* Verifies that {@link AbstractIntlGlobalsTest} matches the behavior of the
* intl functions with a specific version of ICU.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
class IntlGlobalsTest extends AbstractIntlGlobalsTest
{
protected function setUp()
{
IntlTestHelper::requireFullIntl($this);
parent::setUp();
}
protected function getIntlErrorName($errorCode)
{
return intl_error_name($errorCode);
}
}