Esempio n. 1
0
 /**
  * As a primary resource (i.e. mapped to external resource) we need to ensure we have an id for tracking
  * the resource in the system.
  *
  * @return bool
  */
 public function validate()
 {
     if (!$this->id) {
         $this->addError('Resource ID required');
     }
     return parent::validate();
 }
Esempio n. 2
0
 /**
  * @dataProvider xpathremapping_provider
  *
  * @param $xml
  * @param $maps
  * @param $expected
  */
 public function test_Xpathremapping($xml, $maps, $expected)
 {
     $doc = new \DOMDocument();
     $doc->loadXML($xml);
     $remaps = array();
     foreach ($maps as $m) {
         $remaps[] = $this->generateMappings($m);
     }
     BaseResource::remapValues($doc, $remaps);
     $this->assertXmlStringEqualsXmlString($expected, $doc->saveXML());
 }