mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-10 09:52:33 +01:00
PSR2 FunctionClosingBrace
This commit is contained in:
@@ -128,31 +128,31 @@ class ExportTest extends PHPUnit_Framework_TestCase
|
||||
public function testExportOther()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
|
||||
|
||||
$model='csv';
|
||||
|
||||
|
||||
// Creation of class to export using model ExportXXX
|
||||
$dir = DOL_DOCUMENT_ROOT . "/core/modules/export/";
|
||||
$file = "export_".$model.".modules.php";
|
||||
$classname = "Export".$model;
|
||||
require_once $dir.$file;
|
||||
$objmodel = new $classname($this->db);
|
||||
|
||||
|
||||
// First test without option USE_STRICT_CSV_RULES
|
||||
unset($conf->global->USE_STRICT_CSV_RULES);
|
||||
|
||||
|
||||
$valtotest='A simple string';
|
||||
print __METHOD__." valtotest=".$valtotest."\n";
|
||||
$result = $objmodel->csvClean($valtotest, $langs->charset_output);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals($result, 'A simple string');
|
||||
|
||||
|
||||
$valtotest='A string with , and ; inside';
|
||||
print __METHOD__." valtotest=".$valtotest."\n";
|
||||
$result = $objmodel->csvClean($valtotest, $langs->charset_output);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals($result, '"A string with , and ; inside"');
|
||||
|
||||
|
||||
$valtotest='A string with " inside';
|
||||
print __METHOD__." valtotest=".$valtotest."\n";
|
||||
$result = $objmodel->csvClean($valtotest, $langs->charset_output);
|
||||
@@ -164,48 +164,47 @@ class ExportTest extends PHPUnit_Framework_TestCase
|
||||
$result = $objmodel->csvClean($valtotest, $langs->charset_output);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals($result, '"A string with "" inside and \n carriage returns"');
|
||||
|
||||
|
||||
$valtotest='A string with <a href="aaa"><strong>html<br>content</strong></a> inside<br>'."\n";
|
||||
print __METHOD__." valtotest=".$valtotest."\n";
|
||||
$result = $objmodel->csvClean($valtotest, $langs->charset_output);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals($result, '"A string with <a href=""aaa""><strong>html<br>content</strong></a> inside"');
|
||||
|
||||
|
||||
// Same tests with strict mode
|
||||
$conf->global->USE_STRICT_CSV_RULES=1;
|
||||
|
||||
|
||||
$valtotest='A simple string';
|
||||
print __METHOD__." valtotest=".$valtotest."\n";
|
||||
$result = $objmodel->csvClean($valtotest, $langs->charset_output);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals($result, 'A simple string');
|
||||
|
||||
|
||||
$valtotest='A string with , and ; inside';
|
||||
print __METHOD__." valtotest=".$valtotest."\n";
|
||||
$result = $objmodel->csvClean($valtotest, $langs->charset_output);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals($result, '"A string with , and ; inside"');
|
||||
|
||||
|
||||
$valtotest='A string with " inside';
|
||||
print __METHOD__." valtotest=".$valtotest."\n";
|
||||
$result = $objmodel->csvClean($valtotest, $langs->charset_output);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals($result, '"A string with "" inside"');
|
||||
|
||||
|
||||
$valtotest='A string with " inside and '."\r\n".' carriage returns';
|
||||
print __METHOD__." valtotest=".$valtotest."\n";
|
||||
$result = $objmodel->csvClean($valtotest, $langs->charset_output);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals($result, "\"A string with \"\" inside and \r\n carriage returns\"");
|
||||
|
||||
|
||||
$valtotest='A string with <a href="aaa"><strong>html<br>content</strong></a> inside<br>'."\n";
|
||||
print __METHOD__." valtotest=".$valtotest."\n";
|
||||
$result = $objmodel->csvClean($valtotest, $langs->charset_output);
|
||||
print __METHOD__." result=".$result."\n";
|
||||
$this->assertEquals($result, '"A string with <a href=""aaa""><strong>html<br>content</strong></a> inside"');
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Test export function for a personalized dataset
|
||||
*
|
||||
@@ -353,5 +352,5 @@ class ExportTest extends PHPUnit_Framework_TestCase
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user