Qual: More PHPUnit tests
This commit is contained in:
parent
59bac3f5e5
commit
5bd1a05ec7
@ -139,6 +139,8 @@ class ExportTest extends PHPUnit_Framework_TestCase
|
||||
$objexport->array_export_fields[0]=$array_export_fields;
|
||||
$objexport->array_export_alias[0]=$array_alias;
|
||||
|
||||
dol_mkdir($conf->export->dir_temp);
|
||||
|
||||
$model='csv';
|
||||
|
||||
// Build export file
|
||||
@ -163,5 +165,29 @@ class ExportTest extends PHPUnit_Framework_TestCase
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Test export function
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function testExportSociete()
|
||||
{
|
||||
global $conf,$user,$langs,$db;
|
||||
|
||||
$sql = "";
|
||||
$datatoexport='societe_1';
|
||||
$array_selected = array("s.rowid"=>1, "s.nom"=>2); // Mut be fields found into declaration of dataset
|
||||
$model='csv';
|
||||
|
||||
$objexport=new Export($db);
|
||||
$result=$objexport->load_arrays($user,$datatoexport);
|
||||
|
||||
// Build export file
|
||||
$result=$objexport->build_file($user, $model, $datatoexport, $array_selected, $sql);
|
||||
$expectedresult=1;
|
||||
$this->assertEquals($result,$expectedresult);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user