scratch – Blame information for rev 87
?pathlinks?
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\NumberHandler; |
||
15 | use Symfony\Component\CssSelector\Parser\Token; |
||
16 | use Symfony\Component\CssSelector\Parser\Tokenizer\TokenizerPatterns; |
||
17 | |||
18 | class NumberHandlerTest extends AbstractHandlerTest |
||
19 | { |
||
20 | public function getHandleValueTestData() |
||
21 | { |
||
22 | return array( |
||
23 | array('12', new Token(Token::TYPE_NUMBER, '12', 0), ''), |
||
24 | array('12.34', new Token(Token::TYPE_NUMBER, '12.34', 0), ''), |
||
25 | array('+12.34', new Token(Token::TYPE_NUMBER, '+12.34', 0), ''), |
||
26 | array('-12.34', new Token(Token::TYPE_NUMBER, '-12.34', 0), ''), |
||
27 | |||
28 | array('12 arg', new Token(Token::TYPE_NUMBER, '12', 0), ' arg'), |
||
29 | array('12]', new Token(Token::TYPE_NUMBER, '12', 0), ']'), |
||
30 | ); |
||
31 | } |
||
32 | |||
33 | public function getDontHandleValueTestData() |
||
34 | { |
||
35 | return array( |
||
36 | array('hello'), |
||
37 | array('>'), |
||
38 | array('+'), |
||
39 | array(' '), |
||
40 | array('/* comment */'), |
||
41 | ); |
||
42 | } |
||
43 | |||
44 | protected function generateHandler() |
||
45 | { |
||
46 | $patterns = new TokenizerPatterns(); |
||
47 | |||
48 | return new NumberHandler($patterns); |
||
49 | } |
||
50 | } |