Пример #1
0
 public function testResourceOwnerDetailsUrl()
 {
     $token = $this->mockAccessToken();
     $url = $this->provider->getResourceOwnerDetailsUrl($token);
     $uri = parse_url($url);
     $this->assertEquals('/v1/account', $uri['path']);
     $this->assertNotContains('mock_access_token', $url);
 }
Пример #2
0
 /**
  * @return array|null
  */
 private function getNextDataSet()
 {
     if (!$this->nextRequest) {
         return null;
     }
     $responseData = $this->cronofy->getResponse($this->nextRequest);
     $pageData = $responseData['pages'] + ['current' => null, 'total' => null, 'next_page' => null];
     $this->currentPage = $pageData['current'] ? (int) $pageData['current'] : null;
     $this->totalPages = $pageData['total'] ? (int) $pageData['total'] : null;
     if ($pageData['next_page']) {
         $this->nextRequest = $this->cronofy->getAuthenticatedRequest('GET', $pageData['next_page'], $this->token);
     } else {
         $this->nextRequest = null;
     }
     return isset($responseData[$this->namespace]) ? $responseData[$this->namespace] : null;
 }