scratch – Blame information for rev 87

Subversion Repositories:
Rev:
Rev Author Line No. Line
87 office 1 <?php
2  
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11  
12 namespace Symfony\Component\CssSelector\Tests\Parser\Handler;
13  
14 use Symfony\Component\CssSelector\Parser\Handler\StringHandler;
15 use Symfony\Component\CssSelector\Parser\Token;
16 use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns;
17 use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerEscaping;
18  
19 class StringHandlerTest extends AbstractHandlerTest
20 {
21 public function getHandleValueTestData()
22 {
23 return array(
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), ''),
29  
30 array("'foo'bar", new Token(Token::TYPE_STRING, 'foo', 1), 'bar'),
31 );
32 }
33  
34 public function getDontHandleValueTestData()
35 {
36 return array(
37 array('hello'),
38 array('>'),
39 array('1'),
40 array(' '),
41 );
42 }
43  
44 protected function generateHandler()
45 {
46 $patterns = new TokenizerPatterns();
47  
48 return new StringHandler($patterns, new TokenizerEscaping($patterns));
49 }
50 }