Beispiel #1
0
 public function testSetRequestHandler()
 {
     $type = '\\Box\\View\\RequestFoo';
     $requestMock = m::mock($type);
     $this->client->setRequestHandler($requestMock);
     $handler = $this->client->getRequestHandler();
     $this->assertInstanceOf($type, $handler);
 }
Beispiel #2
0
 /**
  * Send a new request to the API.
  *
  * @param \Box\View\Client $client The client instance to make requests from.
  * @param string $requestPath The path to add after the base path.
  * @param array|null $getParams Optional. An associative array of GET params
  *                              to be added to the URL.
  * @param array|null $postParams Optional. An associative array of POST
  *                               params to be sent in the body.
  * @param array|null $requestOptions Optional. An associative array of
  *                                   request options that may modify the way
  *                                   the request is made.
  *
  * @return array|string The response is pass-through from Box\View\Request.
  * @throws \Box\View\BoxViewException
  */
 protected static function request($client, $requestPath, $getParams = [], $postParams = [], $requestOptions = [])
 {
     return $client->getRequestHandler()->send(static::$path . $requestPath, $getParams, $postParams, $requestOptions);
 }