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\CommentHandler;
15 use Symfony\Component\CssSelector\Parser\Reader;
16 use Symfony\Component\CssSelector\Parser\Token;
17 use Symfony\Component\CssSelector\Parser\TokenStream;
19 class CommentHandlerTest extends AbstractHandlerTest
21 /** @dataProvider getHandleValueTestData */
22 public function testHandleValue($value, Token $unusedArgument, $remainingContent)
24 $reader = new Reader($value);
25 $stream = new TokenStream();
27 $this->assertTrue($this->generateHandler()->handle($reader, $stream));
28 // comments are ignored (not pushed as token in stream)
29 $this->assertStreamEmpty($stream);
30 $this->assertRemainingContent($reader, $remainingContent);
33 public function getHandleValueTestData()
36 // 2nd argument only exists for inherited method compatibility
37 array('/* comment */', new Token(null, null, null), ''),
38 array('/* comment */foo', new Token(null, null, null), 'foo'),
42 public function getDontHandleValueTestData()
51 protected function generateHandler()
53 return new CommentHandler();