Skip test when iconv extension is missing
This commit is contained in:
parent
be72520fc3
commit
ae7377d128
@ -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