public function testParseData() { $DDP = new DataDescriptionParser($this->DD); $data = $DDP->parseData(); // all attributes parsed $this->assertEquals(5, count($data['attributes'])); // correct attribute name $this->assertTrue(isset($data['attributes']['Age'])); // all attribute choices parsed $this->assertEquals(47, count($data['attributes']['Age']['choices'])); // correct attribute choice value $this->assertEquals('21', $data['attributes']['Age']['choices'][0]); }
protected function setUp() { $DD = new DOMDocument('1.0', 'UTF-8'); $DD->load(DD, LIBXML_NOBLANKS); $DDP = new DataDescriptionParser($DD); $data = $DDP->parseData(); $this->attributes = $data['attributes']; $FL = new DOMDocument('1.0', 'UTF-8'); $FL->load(FL, LIBXML_NOBLANKS); $FLP = new FeatureListParser($FL, 'en'); $data = $FLP->parseData(); $this->coefficients = $data['BBA']['coefficients']; }
protected function setUp() { $this->ER = new DOMDocument('1.0', 'UTF-8'); $this->ER->load(ERTaskSetting, LIBXML_NOBLANKS); $DD = new DOMDocument('1.0', 'UTF-8'); $DD->load(DD, LIBXML_NOBLANKS); $DDP = new DataDescriptionParser($DD); $data = $DDP->parseData(); $this->attributes = $data['attributes']; $FL = new DOMDocument('1.0', 'UTF-8'); $FL->load(FL, LIBXML_NOBLANKS); $FLP = new FeatureListParser($FL, $lang); $data = $FLP->parseData(); $this->IMs = $data['interestMeasures']; }
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); }
protected function setUp() { $this->ER = new DOMDocument('1.0', 'UTF-8'); $this->ER->load(ERARQuery, LIBXML_NOBLANKS); $this->ERXPath = new DOMXPath($this->ER); $CP = new ConnectiveParser($this->ER, $this->ERXPath); $DD = new DOMDocument('1.0', 'UTF-8'); $DD->load(DD, LIBXML_NOBLANKS); $DDP = new DataDescriptionParser($DD); $data = $DDP->parseData(); $this->attributes = $data['attributes']; $FL = new DOMDocument('1.0', 'UTF-8'); $FL->load(FL, LIBXML_NOBLANKS); $FLP = new FeatureListParser($FL, $lang); $data = $FLP->parseData(); $this->IMs = $data['interestMeasures']; $this->DBAP = new DBAParser($this->ER, $this->ERXPath, $CP); $this->DBAP->parseDBAs(); $this->BBAP = new BBAParser($this->ER, $this->ERXPath); $this->BBAP->parseBBAs(); }