AbstractIntlGlobalsTest.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Intl\Tests\Globals;
  11. use PHPUnit\Framework\TestCase;
  12. /**
  13. * Test case for intl function implementations.
  14. *
  15. * @author Bernhard Schussek <bschussek@gmail.com>
  16. */
  17. abstract class AbstractIntlGlobalsTest extends TestCase
  18. {
  19. public function errorNameProvider()
  20. {
  21. return array(
  22. array(-129, '[BOGUS UErrorCode]'),
  23. array(0, 'U_ZERO_ERROR'),
  24. array(1, 'U_ILLEGAL_ARGUMENT_ERROR'),
  25. array(9, 'U_PARSE_ERROR'),
  26. array(129, '[BOGUS UErrorCode]'),
  27. );
  28. }
  29. /**
  30. * @dataProvider errorNameProvider
  31. */
  32. public function testGetErrorName($errorCode, $errorName)
  33. {
  34. $this->assertSame($errorName, $this->getIntlErrorName($errorCode));
  35. }
  36. abstract protected function getIntlErrorName($errorCode);
  37. }