You are here

class ElementParserTest in Zircon Profile 8.0

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

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

Hierarchy

  • class \Symfony\Component\CssSelector\Tests\Parser\Shortcut\ElementParserTest extends \Symfony\Component\CssSelector\Tests\Parser\Shortcut\PHPUnit_Framework_TestCase

Expanded class hierarchy of ElementParserTest

File

vendor/symfony/css-selector/Tests/Parser/Shortcut/ElementParserTest.php, line 20

Namespace

Symfony\Component\CssSelector\Tests\Parser\Shortcut
View source
class ElementParserTest extends \PHPUnit_Framework_TestCase {

  /** @dataProvider getParseTestData */
  public function testParse($source, $representation) {
    $parser = new ElementParser();
    $selectors = $parser
      ->parse($source);
    $this
      ->assertCount(1, $selectors);

    /** @var SelectorNode $selector */
    $selector = $selectors[0];
    $this
      ->assertEquals($representation, (string) $selector
      ->getTree());
  }
  public function getParseTestData() {
    return array(
      array(
        '*',
        'Element[*]',
      ),
      array(
        'testel',
        'Element[testel]',
      ),
      array(
        'testns|*',
        'Element[testns|*]',
      ),
      array(
        'testns|testel',
        'Element[testns|testel]',
      ),
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ElementParserTest::getParseTestData public function
ElementParserTest::testParse public function @dataProvider getParseTestData