public function CrawlerTest::testAddHtmlContentCharsetGbk in Zircon Profile 8
Same name and namespace in other branches
- 8.0 vendor/symfony/dom-crawler/Tests/CrawlerTest.php \Symfony\Component\DomCrawler\Tests\CrawlerTest::testAddHtmlContentCharsetGbk()
@covers Symfony\Component\DomCrawler\Crawler::addHtmlContent @requires extension mbstring
File
- vendor/
symfony/ dom-crawler/ Tests/ CrawlerTest.php, line 121
Class
Namespace
Symfony\Component\DomCrawler\TestsCode
public function testAddHtmlContentCharsetGbk() {
$crawler = new Crawler();
//gbk encode of <html><p>中文</p></html>
$crawler
->addHtmlContent(base64_decode('PGh0bWw+PHA+1tDOxDwvcD48L2h0bWw+'), 'gbk');
$this
->assertEquals('中文', $crawler
->filterXPath('//p')
->text());
}