forked from Wavyzz/dolibarr
Qual: Add phpunit for dolexplodeintoarray function
This commit is contained in:
@@ -702,5 +702,21 @@ class FunctionsLibTest extends PHPUnit_Framework_TestCase
|
||||
$this->assertEquals(0,$vat1);
|
||||
$this->assertEquals(0,$vat2);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* testDolExplodeIntoArray
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testDolExplodeIntoArray()
|
||||
{
|
||||
$stringtoexplode='AA=B/B.CC=.EE=FF.HH=GG;.';
|
||||
$tmp=dolExplodeIntoArray($stringtoexplode,'.','=');
|
||||
|
||||
print __METHOD__." tmp=".json_encode($tmp)."\n";
|
||||
$this->assertEquals('{"AA":"B\/B","CC":"","EE":"FF","HH":"GG;"}',json_encode($tmp));
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user