WhitespaceHandlerTest.php 1.1 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 [
  18. [' ', new Token(Token::TYPE_WHITESPACE, ' ', 0), ''],
  19. ["\n", new Token(Token::TYPE_WHITESPACE, "\n", 0), ''],
  20. ["\t", new Token(Token::TYPE_WHITESPACE, "\t", 0), ''],
  21. [' foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), 'foo'],
  22. [' .foo', new Token(Token::TYPE_WHITESPACE, ' ', 0), '.foo'],
  23. ];
  24. }
  25. public function getDontHandleValueTestData()
  26. {
  27. return [
  28. ['>'],
  29. ['1'],
  30. ['a'],
  31. ];
  32. }
  33. protected function generateHandler()
  34. {
  35. return new WhitespaceHandler();
  36. }
  37. }