Qual: More PHPUnit tests
This commit is contained in:
parent
fa7f8be3f7
commit
14f2639f4e
@ -139,6 +139,8 @@ class ExportTest extends PHPUnit_Framework_TestCase
|
|||||||
$objexport->array_export_fields[0]=$array_export_fields;
|
$objexport->array_export_fields[0]=$array_export_fields;
|
||||||
$objexport->array_export_alias[0]=$array_alias;
|
$objexport->array_export_alias[0]=$array_alias;
|
||||||
|
|
||||||
|
dol_mkdir($conf->export->dir_temp);
|
||||||
|
|
||||||
$model='csv';
|
$model='csv';
|
||||||
|
|
||||||
// Build export file
|
// Build export file
|
||||||
@ -163,5 +165,29 @@ class ExportTest extends PHPUnit_Framework_TestCase
|
|||||||
return true;
|
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