Actualización

This commit is contained in:
Xes
2025-04-10 12:24:57 +02:00
parent 8969cc929d
commit 45420b6f0d
39760 changed files with 4303286 additions and 0 deletions

View File

@@ -0,0 +1,43 @@
<?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 PHPUnit\Framework\TestCase;
/**
* Test case for intl function implementations.
*
* @author Bernhard Schussek <bschussek@gmail.com>
*/
abstract class AbstractIntlGlobalsTest extends TestCase
{
public function errorNameProvider()
{
return [
[-129, '[BOGUS UErrorCode]'],
[0, 'U_ZERO_ERROR'],
[1, 'U_ILLEGAL_ARGUMENT_ERROR'],
[9, 'U_PARSE_ERROR'],
[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, false);
parent::setUp();
}
protected function getIntlErrorName($errorCode)
{
return intl_error_name($errorCode);
}
}