public function test_it_logs_the_user_in()
 {
     $providerAlias = 'twitbook';
     $socialnormUser = new SocialNorm\User([]);
     $callback = function () {
     };
     $redirector = $this->buildRedirector();
     $authenticator = M::spy('AdamWathan\\EloquentOAuth\\Authenticator');
     $socialnorm = M::mock('SocialNorm\\SocialNorm');
     $socialnorm->shouldReceive('getUser')->with($providerAlias)->andReturn($socialnormUser);
     $oauth = new OAuthManager($redirector, $authenticator, $socialnorm);
     $oauth->login($providerAlias, $callback);
     $authenticator->shouldHaveReceived('login')->with($providerAlias, $socialnormUser, $callback, false);
 }
Пример #2
0
 /**
  * 
  *
  * @static 
  */
 public static function registerProvider($alias, $provider)
 {
     return \AdamWathan\EloquentOAuth\OAuthManager::registerProvider($alias, $provider);
 }