fixed wrong JSON-Mapping for GUIOptions

This commit is contained in:
Werner Masik
2023-04-10 19:08:22 +02:00
parent e7f23643d4
commit fe6a8d5625
4 changed files with 17 additions and 14 deletions
@@ -38,7 +38,7 @@ class GUIGueltigkeit implements JsonSerializable {
{
throw new \Exception('missing guioptions');
}
$this->getJSONData($this->guioptions, $decodedData, 'guioptions');
$this->guioptions = $decodedData;
}
private function mapData(&$decoded)
+6 -4
View File
@@ -22,11 +22,13 @@
* Authors: Werner Masik <werner.masik@gefi.at>
*
*/
require_once('../../config/system.config.inc.php');
require_once('../../include/appdaten.class.php');
require_once('../../include/benutzer.class.php');
require_once( __DIR__.'/../../config/system.config.inc.php');
require_once( __DIR__.'/../../include/appdaten.class.php');
require_once( __DIR__.'/../../include/benutzer.class.php');
class AppdatenTest extends PHPUnit_Framework_TestCase
use PHPUnit\Framework\TestCase;
class AppdatenTest extends TestCase
{
protected $benutzer;
protected $uid = 'unittest';
+5 -4
View File
@@ -18,12 +18,13 @@
* Authors: Werner Masik <werner@gefi.at>,
*/
require_once(__DIR__.'/../../config/vilesci.config.inc.php');
require_once(__DIR__.'/../../include/functions.inc.php');
use PHPUnit\Framework\TestCase;
require_once('../../config/vilesci.config.inc.php');
require_once('../../include/functions.inc.php');
class FunctionsTest extends TestCase
{
@@ -19,17 +19,17 @@ class FormDataTest extends TestCase
$decoded = json_decode($jsondata, true);
$formDataMapper->mapJSON($decoded);
// Dienstverhaeltnis
$dataDV = $formDataMapper->getData();
$dataDV = $formDataMapper->getData();
$this->assertNotEmpty($dataDV);
$this->assertNotEmpty($dataDV['unternehmen']);
$this->assertEquals('gst', $dataDV['unternehmen']);
$this->assertNull($dataDV['dienstverhaeltnisid']);
$this->assertNotEmpty($dataDV['vertragsart_kurzbz']);
$this->assertEquals('echterDV', $dataDV['vertragsart_kurzbz']);
$this->assertEquals('echterdv', $dataDV['vertragsart_kurzbz']);
$this->assertNotEmpty($dataDV['gueltigkeit']);
$this->assertNotEmpty($dataDV['gueltigkeit']['guioptions']);
$this->assertNotEmpty($dataDV['gueltigkeit']['data']);
$this->assertNotEmpty($dataDV['gueltigkeit']['data']['gueltig_ab']);
$this->assertNotEmpty($dataDV['gueltigkeit']->getGuioptions());
$this->assertNotEmpty($dataDV['gueltigkeit']->getData());
$this->assertNotEmpty($dataDV['gueltigkeit']->getData()['gueltig_ab']);
// Vertragsbestandteile
$vbs = $formDataMapper->getVbs();
$this->assertNotEmpty($vbs);