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\StringHandler;
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 StringHandlerTest extends AbstractHandlerTest
21 public function getHandleValueTestData()
24 array('"hello"', new Token(Token::TYPE_STRING, 'hello', 1), ''),
25 array('"1"', new Token(Token::TYPE_STRING, '1', 1), ''),
26 array('" "', new Token(Token::TYPE_STRING, ' ', 1), ''),
27 array('""', new Token(Token::TYPE_STRING, '', 1), ''),
28 array("'hello'", new Token(Token::TYPE_STRING, 'hello', 1), ''),
30 array("'foo'bar", new Token(Token::TYPE_STRING, 'foo', 1), 'bar'),
34 public function getDontHandleValueTestData()
44 protected function generateHandler()
46 $patterns = new TokenizerPatterns();
48 return new StringHandler($patterns, new TokenizerEscaping($patterns));