public function testRequestToken()
 {
     $phpunit = $this;
     Auth1::init(3)->set('key', getenv('FITBIT_KEY'))->set('secret', getenv('FITBIT_SECRET'))->set('callback', getenv('CALLBACK'))->request('http://api.fitbit.com/oauth/request_token')->finally(function ($data) use($phpunit) {
         $phpunit->assertTrue(!empty($data['oauth_token']));
         $phpunit->assertTrue(!empty($data['oauth_token_secret']));
     });
 }
Example #2
0
 public function testLegsThreeLegged()
 {
     $phpunit = $this;
     Auth1::legs(3)->then(function ($data) use($phpunit) {
         $phpunit->assertArrayHasKey('oauth_callback', $data);
         $phpunit->assertArrayHasKey('oauth_consumer_key', $data);
         $phpunit->assertArrayHasKey('oauth_consumer_secret', $data);
         $phpunit->assertArrayHasKey('oauth_nonce', $data);
         $phpunit->assertArrayHasKey('oauth_signature_method', $data);
         $phpunit->assertArrayHasKey('oauth_timestamp', $data);
         $phpunit->assertArrayHasKey('oauth_token', $data);
         $phpunit->assertArrayHasKey('oauth_verifier', $data);
         $phpunit->assertArrayHasKey('oauth_version', $data);
     });
 }