public function testGetParamsWithOptions()
 {
     $params = ['status' => 'new', 'client' => ['test_me' => 'hard']];
     $this->endpoint->shouldReceive('getParamWhiteList')->andReturn(['status']);
     $this->endpoint->setParams($params);
     $this->assertEquals($params, $this->endpoint->getParams());
 }
Пример #2
0
 /**
  * @param AbstractEndpoint $endpoint
  * @param string           $transferClass
  */
 public function __construct(AbstractEndpoint $endpoint, $transferClass)
 {
     $this->transferClass = $transferClass;
     $this->endpoint = $endpoint;
     $this->apiParams = $this->endpoint->getParams();
     $this->apiLimit = $endpoint->getApiLimit();
     if (isset($this->apiParams['offset'])) {
         $this->userOffset = (int) $this->apiParams['offset'];
         $this->apiOffset = $this->userOffset;
     }
     if (isset($this->apiParams['limit'])) {
         $this->userLimit = (int) $this->apiParams['limit'];
         $this->apiLimit = $this->userLimit;
         // Not that much
         if ($this->apiLimit > $endpoint->getApiLimit()) {
             $this->apiLimit = $endpoint->getApiLimit();
         }
     }
 }