Beispiel #1
0
 /**
  * Called $this->web->request(), and decode the json response
  * 
  * @param  string $query Query string to append to the test url
  * @return array
  * @throws Exception
  */
 protected function request($query = null)
 {
     $this->url = self::TEST_URL;
     if (null !== $query) {
         $query = ltrim($query, "?");
         $this->url .= "?{$query}";
     }
     $this->response = $this->web->request($this->url);
     $array = json_decode($this->response->getBody(), true);
     if (!$array) {
         throw new Exception("Testing server did not return json encoded data.");
     }
     return $array;
 }
 public function __construct(array $conf)
 {
     parent::__construct();
     $this->conf = $conf;
 }