public function testParseConfig()
 {
     $FGC = new DOMDocument('1.0', 'UTF-8');
     $FGC->load(FGC, LIBXML_NOBLANKS);
     $FGCP = new FieldGroupConfigParser($FGC, $this->attributes, $this->coefficients, 'en');
     $data = $FGCP->parseConfig();
     $this->assertTrue(array_key_exists(0, $data['groups']));
     $this->assertTrue(array_key_exists(1, $data['groups']));
 }
Example #2
0
 public function parseData()
 {
     $DDParser = new DataDescriptionParser($this->DD);
     $this->data = array_merge_recursive($this->data, $DDParser->parseData());
     $this->data['FLs'] = array();
     foreach ($this->FLs as $FL) {
         $FLParser = new FeatureListParser($FL, $this->lang);
         array_push($this->data['FLs'], $FLParser->parseData());
     }
     usort($this->data['FLs'], array('DataParser', 'sortFLs'));
     $FGCParser = new FieldGroupConfigParser($this->FGC, $this->data['DD'], $this->data['FLs'][0]['BBA']['coefficients'], $this->lang);
     $this->data['FGC'] = $FGCParser->parseConfig();
     $ERParser = new ExistingRulesParser($this->ER, $this->data['DD'], $this->data['FLs'][0]['interestMeasures']);
     $this->data = array_merge_recursive($this->data, $ERParser->parseData());
     $ETreeParser = new ETreeParser($this->ETree, $this->FA);
     $this->data = array_merge_recursive($this->data, $ETreeParser->parseData());
     return $this->toJSON($this->data);
 }