You are here

class HashParserTest in Zircon Profile 8.0

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

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

Hierarchy

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

Expanded class hierarchy of HashParserTest

File

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

Namespace

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

  /** @dataProvider getParseTestData */
  public function testParse($source, $representation) {
    $parser = new HashParser();
    $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(
        '#testid',
        'Hash[Element[*]#testid]',
      ),
      array(
        'testel#testid',
        'Hash[Element[testel]#testid]',
      ),
      array(
        'testns|#testid',
        'Hash[Element[testns|*]#testid]',
      ),
      array(
        'testns|*#testid',
        'Hash[Element[testns|*]#testid]',
      ),
      array(
        'testns|testel#testid',
        'Hash[Element[testns|testel]#testid]',
      ),
    );
  }

}

Members

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