You are here

public function TranslatorTest::testHtmlShakespear in Zircon Profile 8

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

@dataProvider getHtmlShakespearTestData

File

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

Class

TranslatorTest

Namespace

Symfony\Component\CssSelector\Tests\XPath

Code

public function testHtmlShakespear($css, $count) {
  $translator = new Translator();
  $translator
    ->registerExtension(new HtmlExtension($translator));
  $document = new \DOMDocument();
  $document->strictErrorChecking = false;
  $document
    ->loadHTMLFile(__DIR__ . '/Fixtures/shakespear.html');
  $document = simplexml_import_dom($document);
  $bodies = $document
    ->xpath('//body');
  $elements = $bodies[0]
    ->xpath($translator
    ->cssToXPath($css));
  $this
    ->assertEquals($count, count($elements));
}