示例#1
0
 function testValidatePayloadSchema()
 {
     $a = new Services_Gnip_Activity($this->at, $this->action, $this->activityID, $this->URL, $this->source, $this->keyword, null, $this->actor, $this->destinationURL, $this->tag, $this->to, $this->regardingURL, array($this->payload, $this->payloadArray));
     $d = new GnipDOMDocument();
     $d->loadXML($a->toXML());
     $status = $d->schemaValidate(dirname(__FILE__) . '../../../src/Services/Gnip/gnip.xsd');
     $this->assertEquals($status, true);
 }
示例#2
0
 /**
  * Validates the xml data against Gnip schema.
  * 
  * @param string $xml
  * @return string xml you passed in
  */
 private function validate($xml)
 {
     $doc = new GnipDOMDocument();
     $doc->loadXML($xml);
     $doc->schemaValidate(dirname(__FILE__) . '/gnip.xsd');
     return $xml;
 }