/** @brief Construct new manager with all necessary client data helpers.
  *
  * One or more client data helper can be created and managed.
  * @param $client_datas [in] root of client data element.
  */
 public function __construct($client_datas)
 {
     foreach ($client_datas as $data) {
         $helper = AfsClientDataHelperFactory::create($data);
         $this->client_data[$helper->id] = $helper;
     }
 }
Example #2
0
 public function testRetrieveUnknownSpecificJSONDataAsTextWithHighlight()
 {
     $input = json_decode('{
         "clientData": [
           {
             "contents": { "foo": [ { "afs:t": "KwicString", "text": "data " },
                                    { "afs:t": "KwicMatch", "match": "1" } ] },
             "id": "id1",
             "mimeType": "application/json"
           }
         ]
       }');
     $helper = AfsClientDataHelperFactory::create($input->clientData[0]);
     try {
         $helper->get_value('bar');
         $this->fail('Unknown JSON element should have rosen exception');
     } catch (AfsClientDataException $e) {
     }
 }