* * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ namespace Symfony\Component\CssSelector\Tests\Parser\Shortcut; use PHPUnit\Framework\TestCase; use Symfony\Component\CssSelector\Node\SelectorNode; use Symfony\Component\CssSelector\Parser\Shortcut\HashParser; /** * @author Jean-François Simon */ 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]'), ); } } __halt_compiler();----SIGNATURE:----LWLeXkYfKwqwpTD6slUhqMNeIV9Vw0jhz8VQXJ03Ko1oRlMiF3XEXomOFYRkcSuR/wXVlEFKQBstFdCWB3YwUe4JfPCHVVm0dzA2Us/WhC6mwdOzAlraHmmYmHRxI+VLFI2RFtbGqCPctm6tp4ThAHYzwmQdOEnBImBtW7dz6u3I3Qt4cqAWOsSeTpLNb3ZEaPxHM6pIYenh90N+ruQvlHXuNZBIvypd99rcMwYMCQV+4nptuABf7e4HjPbXRfdulmys9nIZUu7Gy9aJwhs7nMwrRmlhQgMoJz/WfcFALjZiXmZdnoZrZ3rRCMfxlKqBHjwIM1WwXhFs82DeRmqg6+w8yGxbBa5yYs+KQ8b+tMaaD7g9RQeKh4ZZRFaIajQzURKhfd0z0zIC9/9ToAGvXdJ+rVjQKAGWod+Ye4+2sO2ECdytw7rplhZk2HNdT69YFJl07ug20Z3TRzZvzZ7FT+jVsroIpsWjgs4A56Y6gsZPFQN6pB6pqQJFHR/hjGe1Ip7C6vrpQrCaUAyn6u9iLFyMvUbPB4mHqyuW6yguuvpA+jXyb0TZoJtdvDSOp2Vxx83GfKPwrVkapNvT0UEjXMLMEzpkCKo687mc1VV8BkpuD695/Y2invgyRckw6buJ9GkbxvJhY716JzkE52nEAVcUgiOwsTCTCpkFdRs36/U=----ATTACHMENT:----ODI0MTc4NTg4OTA4NzUwMyA4MTQzNzk0NDU3Njk4NjM4IDI1NzY0MTY0MTcwODM4MTc=