/** @brief Creates appropriate reply helper.
  *
  * @param $feed [in] name of the feed reply.
  * @param $reply [in] JSON decoded reply used to initialize the helper.
  *
  * @return standard or Promote reply helper.
  */
 public function create($feed, $reply)
 {
     if ('Promote' == $feed) {
         $xmlstring = $reply->clientData[0]->contents;
         $xmlstring = '<promote>' . $xmlstring . '</promote>';
         $clientdata = clone $reply->clientData[0];
         $clientdata->contents = $xmlstring;
         $xmlclientdata = new AfsXmlClientDataHelper($clientdata);
         if ($xmlclientdata instanceof AfsJsonClientDataHelper) {
             $type = $xmlclientdata->get_value('type');
         } elseif ($xmlclientdata instanceof AfsXmlClientDataHelper) {
             $type = $xmlclientdata->get_value('/promote/afs:type', array("afs" => "http://ref.antidot.net/7.3/bo.xsd"));
         }
         switch ($type) {
             case "default":
                 return new AfsPromoteReplyHelper($reply);
             case "banner":
                 return new AfsPromoteBannerReplyHelper($reply);
             case "redirection":
                 return new AfsPromoteRedirectReplyHelper($reply);
                 break;
             default:
                 throw new AfsUnknowPromoteTypeException($type);
                 break;
         }
     } else {
         return new AfsReplyHelper($reply, $this->visitor);
     }
 }
 /**
  * @expectedException AfsNoResultException
  */
 public function testXmlCltDataNoElementFoundgetNodes()
 {
     $xml_client_data = '<clientData><data1>value1</data1><data1><k>v</k></data1></clientData>';
     $input = json_decode('
           {
             "contents": "' . $xml_client_data . '",
             "id": "id1",
             "mimeType": "application/json"
           }');
     $xml_clientdata = new AfsXmlClientDataHelper($input);
     $xml_clientdata->get_node("/foo");
 }