public function TranslatorTest::testHtmlShakespear in Zircon Profile 8
Same name and namespace in other branches
- 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
Namespace
Symfony\Component\CssSelector\Tests\XPathCode
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));
}