You are here

class ClassParserTest in Zircon Profile 8.0

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

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

Hierarchy

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

Expanded class hierarchy of ClassParserTest

File

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

Namespace

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

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

}

Members

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