minor #20852 Skip test when iconv extension is missing (julienfalque)

This PR was merged into the 2.7 branch.

Discussion
----------

Skip test when iconv extension is missing

| Q             | A
| ------------- | ---
| Branch?       | 2.7
| Bug fix?      | no
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | -
| License       | MIT
| Doc PR        | -

Commits
-------

ae7377d Skip test when iconv extension is missing
This commit is contained in:
Fabien Potencier 2016-12-10 15:23:12 +01:00
commit 3113f3f93f
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');