You are here

public function EmptyStringParserTest::testParse in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/css-selector/Tests/Parser/Shortcut/EmptyStringParserTest.php \Symfony\Component\CssSelector\Tests\Parser\Shortcut\EmptyStringParserTest::testParse()

File

vendor/symfony/css-selector/Tests/Parser/Shortcut/EmptyStringParserTest.php, line 22

Class

EmptyStringParserTest
@author Jean-François Simon <jeanfrancois.simon@sensiolabs.com>

Namespace

Symfony\Component\CssSelector\Tests\Parser\Shortcut

Code

public function testParse() {
  $parser = new EmptyStringParser();
  $selectors = $parser
    ->parse('');
  $this
    ->assertCount(1, $selectors);

  /** @var SelectorNode $selector */
  $selector = $selectors[0];
  $this
    ->assertEquals('Element[*]', (string) $selector
    ->getTree());
  $selectors = $parser
    ->parse('this will produce an empty array');
  $this
    ->assertCount(0, $selectors);
}