WordPress at a glance
class is not described

Symfony\Component\CssSelector\Tests\Parser\Shortcut

HashParserTest{} WC 1.0

No Hooks.

Return

null. Nothing.

Usage

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

Methods

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

Code of HashParserTest{} WC 5.3.0

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