AbstractIntlGlobalsTest.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  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. /**
  12. * Test case for intl function implementations.
  13. *
  14. * @author Bernhard Schussek <bschussek@gmail.com>
  15. */
  16. abstract class AbstractIntlGlobalsTest extends \PHPUnit_Framework_TestCase
  17. {
  18. public function errorNameProvider()
  19. {
  20. return array (
  21. array(-129, '[BOGUS UErrorCode]'),
  22. array(0, 'U_ZERO_ERROR'),
  23. array(1, 'U_ILLEGAL_ARGUMENT_ERROR'),
  24. array(9, 'U_PARSE_ERROR'),
  25. array(129, '[BOGUS UErrorCode]'),
  26. );
  27. }
  28. /**
  29. * @dataProvider errorNameProvider
  30. */
  31. public function testGetErrorName($errorCode, $errorName)
  32. {
  33. $this->assertSame($errorName, $this->getIntlErrorName($errorCode));
  34. }
  35. abstract protected function getIntlErrorName($errorCode);
  36. }