You are here

public function CssSelectorTest::testCssToXPath in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/css-selector/Tests/CssSelectorTest.php \Symfony\Component\CssSelector\Tests\CssSelectorTest::testCssToXPath()

File

vendor/symfony/css-selector/Tests/CssSelectorTest.php, line 18

Class

CssSelectorTest

Namespace

Symfony\Component\CssSelector\Tests

Code

public function testCssToXPath() {
  $this
    ->assertEquals('descendant-or-self::*', CssSelector::toXPath(''));
  $this
    ->assertEquals('descendant-or-self::h1', CssSelector::toXPath('h1'));
  $this
    ->assertEquals("descendant-or-self::h1[@id = 'foo']", CssSelector::toXPath('h1#foo'));
  $this
    ->assertEquals("descendant-or-self::h1[@class and contains(concat(' ', normalize-space(@class), ' '), ' foo ')]", CssSelector::toXPath('h1.foo'));
  $this
    ->assertEquals('descendant-or-self::foo:h1', CssSelector::toXPath('foo|h1'));
}