Skip test when iconv extension is missing

This commit is contained in:
Julien Falque 2016-12-09 18:49:43 +01:00
parent be72520fc3
commit ae7377d128
No known key found for this signature in database
GPG Key ID: 6B13BB4B40DBD0E9
1 changed files with 6 additions and 0 deletions

View File

@ -206,7 +206,13 @@ EOF
$crawler = new Crawler();
$crawler->addContent('<html><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><span>中文</span></html>');
$this->assertEquals('中文', $crawler->filterXPath('//span')->text(), '->addContent() guess wrong charset');
}
/**
* @requires extension iconv
*/
public function testAddContentNonUtf8()
{
$crawler = new Crawler();
$crawler->addContent(iconv('UTF-8', 'SJIS', '<html><head><meta charset="Shift_JIS"></head><body>日本語</body></html>'));
$this->assertEquals('日本語', $crawler->filterXPath('//body')->text(), '->addContent() can recognize "Shift_JIS" in html5 meta charset tag');