You are here

public function TranslatorTest::testXmlLang in Zircon Profile 8.0

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

@dataProvider getXmlLangTestData

File

vendor/symfony/css-selector/Tests/XPath/TranslatorTest.php, line 34

Class

TranslatorTest

Namespace

Symfony\Component\CssSelector\Tests\XPath

Code

public function testXmlLang($css, array $elementsId) {
  $translator = new Translator();
  $document = new \SimpleXMLElement(file_get_contents(__DIR__ . '/Fixtures/lang.xml'));
  $elements = $document
    ->xpath($translator
    ->cssToXPath($css));
  $this
    ->assertEquals(count($elementsId), count($elements));
  foreach ($elements as $element) {
    $this
      ->assertTrue(in_array($element
      ->attributes()->id, $elementsId));
  }
}