WordPress at a glance
class is not described

Symfony\Component\CssSelector\Tests\Parser\Shortcut

ElementParserTest{} WC 1.0

No Hooks.

Return

null. Nothing.

Usage

$ElementParserTest = new ElementParserTest();
// use class methods

Methods

  1. getParseTestData()
  2. testParse($source, $representation)

Code of ElementParserTest{} WC 5.3.0

<?php
class ElementParserTest extends 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]'),
        );
    }
}