Verified Commit 5926030f authored by Damien's avatar Damien

FEAT #9104 Export Unit tests

parent e4cf793c
......@@ -95,7 +95,8 @@ class ExportControllerTest extends TestCase
]
];
//CSV
//PDF
$aArgs['format'] = 'pdf';
$fullRequest = \httpRequestCustom::addContentInBody($aArgs, $request);
$response = $ExportController->updateExport($fullRequest, new \Slim\Http\Response(), ['userId' => 19, 'groupId' => 2, 'basketId' => 10]);
......@@ -110,15 +111,13 @@ class ExportControllerTest extends TestCase
$response = $ExportController->getExportTemplates($request, new \Slim\Http\Response());
$responseBody = json_decode((string)$response->getBody());
$templateData = (array)$responseBody->templates->csv->data;
$templateData = (array)$responseBody->templates->pdf->data;
foreach ($templateData as $key => $value) {
$templateData[$key] = (array)$value;
}
$this->assertSame($aArgs['data'], $templateData);
$this->assertSame(';', $responseBody->templates->csv->delimiter);
//PDF
$aArgs['format'] = 'pdf';
//CSV
$fullRequest = \httpRequestCustom::addContentInBody($aArgs, $request);
$response = $ExportController->updateExport($fullRequest, new \Slim\Http\Response(), ['userId' => 19, 'groupId' => 2, 'basketId' => 10]);
......@@ -133,11 +132,12 @@ class ExportControllerTest extends TestCase
$response = $ExportController->getExportTemplates($request, new \Slim\Http\Response());
$responseBody = json_decode((string)$response->getBody());
$templateData = (array)$responseBody->templates->pdf->data;
$templateData = (array)$responseBody->templates->csv->data;
foreach ($templateData as $key => $value) {
$templateData[$key] = (array)$value;
}
$this->assertSame($aArgs['data'], $templateData);
$this->assertSame(';', $responseBody->templates->csv->delimiter);
//ERRORS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment