CanonicalizerTest.php 859 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /*
  3. * This file is part of the FOSUserBundle package.
  4. *
  5. * (c) FriendsOfSymfony <http://friendsofsymfony.github.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 FOS\UserBundle\Tests\Util;
  11. use FOS\UserBundle\Util\Canonicalizer;
  12. class CanonicalizerTest extends \PHPUnit_Framework_TestCase
  13. {
  14. /**
  15. * @dataProvider canonicalizeProvider
  16. */
  17. public function testCanonicalize($source, $expectedResult)
  18. {
  19. $canonicalizer = new Canonicalizer();
  20. $this->assertEquals($expectedResult, $canonicalizer->canonicalize($source));
  21. }
  22. public function canonicalizeProvider()
  23. {
  24. return array(
  25. array('FOO', 'foo'),
  26. array(chr(171), PHP_VERSION_ID < 50600 ? chr(171) : '?'),
  27. );
  28. }
  29. }