2
0
forked from Wavyzz/dolibarr

Merge branch 'patch-2' of github.com:marcosgdf/dolibarr into

marcosgdf-patch-2

Conflicts:
	test/phpunit/Functions2LibTest.php
This commit is contained in:
Laurent Destailleur
2014-07-31 17:21:46 +02:00
15 changed files with 113 additions and 94 deletions

View File

@@ -787,4 +787,26 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
$this->assertEquals('{"AA":"B\/B","CC":"","EE":"FF","HH":"GG;"}',json_encode($tmp));
}
/**
* dol_nl2br
*
* @return void
*/
public function testDolNl2Br() {
//String to encode
$string = "a\na";
$this->assertEquals(dol_nl2br($string), "a<br>\na");
//With $forxml parameter
$this->assertEquals(dol_nl2br($string, 0, 1), "a<br />\na");
//Replacing \n by br
$this->assertEquals(dol_nl2br($string, 1), "a<br>a");
//With $forxml parameter
$this->assertEquals(dol_nl2br($string, 1, 1), "a<br />a");
}
}