fixed tests

This commit is contained in:
Roland Gruber 2020-06-17 12:57:18 +02:00
parent 9ec8d2ce57
commit ee75385e7d
2 changed files with 14 additions and 2 deletions

View File

@ -80,7 +80,6 @@ class ConfigDataExporter {
* TODO
*
* webauthn
* cron job runs
*/
return json_encode($jsonData);
}

View File

@ -62,6 +62,14 @@ class ConfigDataExporterTest extends TestCase {
'group' => array('default' => array('key' => 'value')),
)),
);
$pdfTemplateData = array(
'user' => array('default' => array('key' => 'value')),
'group' => array('default' => array('key' => 'value')),
);
$selfServiceData = array(
'profile1' => array('key' => 'value'),
'profile2' => array('key' => 'value'),
);
$expectedJson = json_encode(array(
'mainConfig' => $mainData,
'certificates' => 'certs',
@ -69,11 +77,14 @@ class ConfigDataExporterTest extends TestCase {
'accountProfiles' => $accountProfileData,
'accountProfileTemplates' => $accountProfileTemplateData,
'pdfProfiles' => $pdfData,
'pdfProfileTemplates' => $pdfTemplateData,
'selfServiceProfiles' => $selfServiceData,
));
$exporter = $this->getMockBuilder('\LAM\PERSISTENCE\ConfigDataExporter')
->setMethods(array('_getMainConfigData', '_getCertificates', '_getServerProfiles',
'_getAccountProfiles', '_getAccountProfileTemplates', '_getPdfProfiles'))
'_getAccountProfiles', '_getAccountProfileTemplates', '_getPdfProfiles',
'_getPdfProfileTemplates', '_getSelfServiceProfiles'))
->getMock();
$exporter->method('_getMainConfigData')->willReturn($mainData);
$exporter->method('_getCertificates')->willReturn('certs');
@ -81,6 +92,8 @@ class ConfigDataExporterTest extends TestCase {
$exporter->method('_getAccountProfiles')->willReturn($accountProfileData);
$exporter->method('_getAccountProfileTemplates')->willReturn($accountProfileTemplateData);
$exporter->method('_getPdfProfiles')->willReturn($pdfData);
$exporter->method('_getPdfProfileTemplates')->willReturn($pdfTemplateData);
$exporter->method('_getSelfServiceProfiles')->willReturn($selfServiceData);
$json = $exporter->exportAsJson();