1cf742cf201609977c15eea3dade8d8cac235a83
[yaffs-website] / vendor / symfony / css-selector / Tests / Parser / Shortcut / EmptyStringParserTest.php
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\Shortcut;
13
14 use PHPUnit\Framework\TestCase;
15 use Symfony\Component\CssSelector\Node\SelectorNode;
16 use Symfony\Component\CssSelector\Parser\Shortcut\EmptyStringParser;
17
18 /**
19  * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>
20  */
21 class EmptyStringParserTest extends TestCase
22 {
23     public function testParse()
24     {
25         $parser = new EmptyStringParser();
26         $selectors = $parser->parse('');
27         $this->assertCount(1, $selectors);
28
29         /** @var SelectorNode $selector */
30         $selector = $selectors[0];
31         $this->assertEquals('Element[*]', (string) $selector->getTree());
32
33         $selectors = $parser->parse('this will produce an empty array');
34         $this->assertCount(0, $selectors);
35     }
36 }