WhitespaceHandlerTest.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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\CssSelector\Tests\Parser\Handler;
  11. use Symfony\Component\CssSelector\Parser\Handler\WhitespaceHandler;
  12. use Symfony\Component\CssSelector\Parser\Token;
  13. class WhitespaceHandlerTest extends AbstractHandlerTest
  14. {
  15. public function getHandleValueTestData()
  16. {
  17. return array(
  18. array(' ', new Token(Token::TYPE_WHITESPACE, ' ', 0), ''),
  19. array("\n", new Token(Token::TYPE_WHITESPACE, "\n", 0), ''),
  20. array("\t", new Token(Token::TYPE_WHITESPACE, "\t", 0), ''),
  21. array(' foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), 'foo'),
  22. array(' .foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), '.foo'),
  23. );
  24. }
  25. public function getDontHandleValueTestData()
  26. {
  27. return array(
  28. array('>'),
  29. array('1'),
  30. array('a'),
  31. );
  32. }
  33. protected function generateHandler()
  34. {
  35. return new WhitespaceHandler();
  36. }
  37. }