4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\CssSelector\Tests\Parser\Handler;
14 use Symfony\Component\CssSelector\Parser\Handler\IdentifierHandler;
15 use Symfony\Component\CssSelector\Parser\Token;
16 use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping;
17 use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
19 class IdentifierHandlerTest extends AbstractHandlerTest
21 public function getHandleValueTestData()
24 array('foo', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ''),
25 array('foo|bar', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '|bar'),
26 array('foo.class', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '.class'),
27 array('foo[attr]', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), '[attr]'),
28 array('foo bar', new Token(Token::TYPE_IDENTIFIER, 'foo', 0), ' bar'),
32 public function getDontHandleValueTestData()
39 array('/* comment */'),
43 protected function generateHandler()
45 $patterns = new TokenizerPatterns();
47 return new IdentifierHandler($patterns, new TokenizerEscaping($patterns));