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