Example #1
0
 public function testGetElementsByTagName()
 {
     $element = new TXmlElement('tag');
     $element->Elements[] = new TXmlElement('tag');
     $element->Elements[] = new TXmlElement('tag');
     self::assertEquals(2, count($element->getElementsByTagName('tag')));
 }
Example #2
0
 /**
  * Loads the service configuration
  * @param TXmlElement $xml configuration
  */
 public function loadConfig(TXmlElement $xml)
 {
     foreach ($xml->getElementsByTagName('rpcapi') as $_apiProviderXml) {
         $_properties = $_apiProviderXml->getAttributes();
         if (($_id = $_properties->remove('id')) === null || $_id == "") {
             throw new TConfigurationException('rpcservice_apiproviderid_required');
         }
         if (isset($this->apiProviders[$_id])) {
             throw new TConfigurationException('rpcservice_apiproviderid_duplicated');
         }
         $this->apiProviders[$_id] = $_properties;
     }
 }