コード例 #1
0
ファイル: ApiTest.php プロジェクト: hansott/pinterest-php
 public function setUp()
 {
     $cacheDir = sprintf('%s/responses', __DIR__);
     if (!is_dir($cacheDir)) {
         throw new RuntimeException('The cache directory does not exist or is not a directory');
     }
     $client = new BuzzClient();
     $mocked = new MockClient($client, $cacheDir);
     $auth = Authentication::withAccessToken($mocked, null, null, getenv('ACCESS_TOKEN'));
     $this->api = new Api($auth);
     $this->boardId = getenv('BOARD_ID');
 }
コード例 #2
0
 public function testConstructWithAccessToken()
 {
     $accessToken = 'access-token';
     $auth = Authentication::withAccessToken($this->getHttpClient(), 'client-id', 'client-secret', $accessToken);
     $this->assertSame($accessToken, $auth->getAccessToken());
 }