mirror of
https://github.com/Combodo/iTop.git
synced 2026-03-02 15:44:11 +01:00
N°2558 Test for the HTMLDOMSanitizer white list : remove new lines
the parser gives different results depending on the PHP version Didn't manage to get it right : - no php.ini difference - playing with the parser preserveWhitespace/formatOutput parser options didn't help So we're removing new lines on both sides :/
This commit is contained in:
@@ -24,11 +24,18 @@ class HTMLDOMSanitizerTest extends ItopTestCase
|
||||
{
|
||||
$sInputHtml = $this->ReadTestFile($sFileToTest, self::INPUT_DIRECTORY);
|
||||
$sOutputHtml = $this->ReadTestFile($sFileToTest, self::OUTPUT_DIRECTORY);
|
||||
$sOutputHtml = $this->RemoveNewLines($sOutputHtml);
|
||||
|
||||
$oSanitizer = new HTMLDOMSanitizer();
|
||||
$sRes = $oSanitizer->DoSanitize($sInputHtml);
|
||||
|
||||
// Removing newlines as the parser gives different results depending on the PHP version
|
||||
// Didn't manage to get it right :
|
||||
// - no php.ini difference
|
||||
// - playing with the parser preserveWhitespace/formatOutput parser options didn't help
|
||||
// So we're removing new lines on both sides :/
|
||||
$sOutputHtml = $this->RemoveNewLines($sOutputHtml);
|
||||
$sRes = $this->RemoveNewLines($sRes);
|
||||
|
||||
$this->debug($sRes);
|
||||
$this->assertEquals($sOutputHtml, $sRes);
|
||||
}
|
||||
@@ -71,7 +78,14 @@ class HTMLDOMSanitizerTest extends ItopTestCase
|
||||
$oSanitizer = new HTMLDOMSanitizer();
|
||||
$sRes = $oSanitizer->DoSanitize($sHtmlToTest);
|
||||
|
||||
$this->debug($sRes);
|
||||
// Removing newlines as the parser gives different results depending on the PHP version
|
||||
// Didn't manage to get it right :
|
||||
// - no php.ini difference
|
||||
// - playing with the parser preserveWhitespace/formatOutput parser options didn't help
|
||||
// So we're removing new lines on both sides :/
|
||||
$sHtmlToTest = $this->RemoveNewLines($sHtmlToTest);
|
||||
$sRes = $this->RemoveNewLines($sRes);
|
||||
|
||||
$this->assertEquals($sHtmlToTest, $sRes);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user