Skip to content

Commit

Permalink
Merge 5b60de4 into ae01838
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrooksuk committed Jan 8, 2015
2 parents ae01838 + 5b60de4 commit e862fce
Show file tree
Hide file tree
Showing 24 changed files with 108 additions and 108 deletions.
22 changes: 11 additions & 11 deletions src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,18 @@ public function __isset($name)
public function getArrayCopy()
{
return [
'uid' => $this->uid,
'nickname' => $this->nickname,
'name' => $this->name,
'firstName' => $this->firstName,
'lastName' => $this->lastName,
'email' => $this->email,
'location' => $this->location,
'uid' => $this->uid,
'nickname' => $this->nickname,
'name' => $this->name,
'firstName' => $this->firstName,
'lastName' => $this->lastName,
'email' => $this->email,
'location' => $this->location,
'description' => $this->description,
'imageUrl' => $this->imageUrl,
'urls' => $this->urls,
'gender' => $this->gender,
'locale' => $this->locale,
'imageUrl' => $this->imageUrl,
'urls' => $this->urls,
'gender' => $this->gender,
'locale' => $this->locale,
];
}

Expand Down
10 changes: 5 additions & 5 deletions src/Provider/AbstractProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,11 @@ public function getAuthorizationUrl($options = [])
$this->state = isset($options['state']) ? $options['state'] : md5(uniqid(rand(), true));

$params = [
'client_id' => $this->clientId,
'redirect_uri' => $this->redirectUri,
'state' => $this->state,
'scope' => is_array($this->scopes) ? implode($this->scopeSeparator, $this->scopes) : $this->scopes,
'response_type' => isset($options['response_type']) ? $options['response_type'] : 'code',
'client_id' => $this->clientId,
'redirect_uri' => $this->redirectUri,
'state' => $this->state,
'scope' => is_array($this->scopes) ? implode($this->scopeSeparator, $this->scopes) : $this->scopes,
'response_type' => isset($options['response_type']) ? $options['response_type'] : 'code',
'approval_prompt' => 'auto',
];

Expand Down
2 changes: 1 addition & 1 deletion src/Provider/Eventbrite.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function userDetails($response, \League\OAuth2\Client\Token\AccessToken $
{
$user = new User();
$user->exchangeArray([
'uid' => $response->user->user_id,
'uid' => $response->user->user_id,
'email' => $response->user->email,
]);

Expand Down
18 changes: 9 additions & 9 deletions src/Provider/Facebook.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@ public function userDetails($response, \League\OAuth2\Client\Token\AccessToken $
$imageUrl = ($imageUrl) ?: null;

$user->exchangeArray([
'uid' => $response->id,
'nickname' => $username,
'name' => $response->name,
'firstname' => $response->first_name,
'lastname' => $response->last_name,
'email' => $email,
'location' => $location,
'uid' => $response->id,
'nickname' => $username,
'name' => $response->name,
'firstname' => $response->first_name,
'lastname' => $response->last_name,
'email' => $email,
'location' => $location,
'description' => $description,
'imageurl' => $imageUrl,
'urls' => [ 'Facebook' => $response->link ],
'imageurl' => $imageUrl,
'urls' => [ 'Facebook' => $response->link ],
]);

return $user;
Expand Down
8 changes: 4 additions & 4 deletions src/Provider/Github.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ public function userDetails($response, \League\OAuth2\Client\Token\AccessToken $
$email = (isset($response->email)) ? $response->email : null;

$user->exchangeArray([
'uid' => $response->id,
'uid' => $response->id,
'nickname' => $response->login,
'name' => $name,
'email' => $email,
'urls' => [
'name' => $name,
'email' => $email,
'urls' => [
'GitHub' => $this->domain.'/'.$response->login,
],
]);
Expand Down
10 changes: 5 additions & 5 deletions src/Provider/Google.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ public function userDetails($response, \League\OAuth2\Client\Token\AccessToken $
$response['emails'][0]->value)? $response['emails'][0]->value : null;

$user->exchangeArray([
'uid' => $response['id'],
'name' => $response['displayName'],
'uid' => $response['id'],
'name' => $response['displayName'],
'firstname' => $response['name']->givenName,
'lastName' => $response['name']->familyName,
'email' => $email,
'imageUrl' => $imageUrl,
'lastName' => $response['name']->familyName,
'email' => $email,
'imageUrl' => $imageUrl,
]);

return $user;
Expand Down
8 changes: 4 additions & 4 deletions src/Provider/Instagram.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ public function userDetails($response, \League\OAuth2\Client\Token\AccessToken $
$description = (isset($response->data->bio)) ? $response->data->bio : null;

$user->exchangeArray([
'uid' => $response->data->id,
'nickname' => $response->data->username,
'name' => $response->data->full_name,
'uid' => $response->data->id,
'nickname' => $response->data->username,
'name' => $response->data->full_name,
'description' => $description,
'imageUrl' => $response->data->profile_picture,
'imageUrl' => $response->data->profile_picture,
]);

return $user;
Expand Down
16 changes: 8 additions & 8 deletions src/Provider/LinkedIn.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ public function userDetails($response, AccessToken $token)
$pictureUrl = (isset($response->pictureUrl)) ? $response->pictureUrl : null;

$user->exchangeArray([
'uid' => $response->id,
'name' => $response->firstName.' '.$response->lastName,
'firstname' => $response->firstName,
'lastname' => $response->lastName,
'email' => $email,
'location' => $location,
'uid' => $response->id,
'name' => $response->firstName.' '.$response->lastName,
'firstname' => $response->firstName,
'lastname' => $response->lastName,
'email' => $email,
'location' => $location,
'description' => $description,
'imageurl' => $pictureUrl,
'urls' => $response->publicProfileUrl,
'imageurl' => $pictureUrl,
'urls' => $response->publicProfileUrl,
]);

return $user;
Expand Down
12 changes: 6 additions & 6 deletions src/Provider/Microsoft.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ public function userDetails($response, AccessToken $token)
$email = (isset($response->emails->preferred)) ? $response->emails->preferred : null;

$user->exchangeArray([
'uid' => $response->id,
'name' => $response->name,
'uid' => $response->id,
'name' => $response->name,
'firstname' => $response->first_name,
'lastname' => $response->last_name,
'email' => $email,
'imageurl' => $imageUrl,
'urls' => $response->link.'/cid-'.$response->id,
'lastname' => $response->last_name,
'email' => $email,
'imageurl' => $imageUrl,
'urls' => $response->link.'/cid-'.$response->id,
]);

return $user;
Expand Down
16 changes: 8 additions & 8 deletions src/Provider/Vkontakte.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@ public function userDetails($response, AccessToken $token)
$description = (isset($response->status)) ? $response->status : null;

$user->exchangeArray([
'uid' => $response->uid,
'nickname' => $response->nickname,
'name' => $response->screen_name,
'firstname' => $response->first_name,
'lastname' => $response->last_name,
'email' => $email,
'location' => $location,
'uid' => $response->uid,
'nickname' => $response->nickname,
'name' => $response->screen_name,
'firstname' => $response->first_name,
'lastname' => $response->last_name,
'email' => $email,
'location' => $location,
'description' => $description,
'imageUrl' => $response->photo_200_orig,
'imageUrl' => $response->photo_200_orig,
]);

return $user;
Expand Down
22 changes: 11 additions & 11 deletions test/src/Entity/UserTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ public function setUp()
$this->user = new User();

$this->userArray = [
'uid' => 'mock_uid',
'nickname' => 'mock_nickname',
'name' => 'mock_name',
'firstName' => 'mock_firstName',
'lastName' => 'mock_lastName',
'email' => 'mock_email',
'location' => 'mock_location',
'uid' => 'mock_uid',
'nickname' => 'mock_nickname',
'name' => 'mock_name',
'firstName' => 'mock_firstName',
'lastName' => 'mock_lastName',
'email' => 'mock_email',
'location' => 'mock_location',
'description' => 'mock_description',
'imageUrl' => 'mock_imageUrl',
'urls' => 'mock_urls',
'gender' => 'mock_gender',
'locale' => 'mock_locale',
'imageUrl' => 'mock_imageUrl',
'urls' => 'mock_urls',
'gender' => 'mock_gender',
'locale' => 'mock_locale',
];
}

Expand Down
4 changes: 2 additions & 2 deletions test/src/Grant/AuthorizationCodeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class AuthorizationCodeTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
$this->provider = new \League\OAuth2\Client\Provider\Google([
'clientId' => 'mock_client_id',
'clientId' => 'mock_client_id',
'clientSecret' => 'mock_secret',
'redirectUri' => 'none',
'redirectUri' => 'none',
]);
}

Expand Down
4 changes: 2 additions & 2 deletions test/src/Grant/ClientCredentialsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class ClientCredentialsTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
$this->provider = new \League\OAuth2\Client\Provider\Google(array(
'clientId' => 'mock_client_id',
'clientId' => 'mock_client_id',
'clientSecret' => 'mock_secret',
'redirectUri' => 'none',
'redirectUri' => 'none',
));
}

Expand Down
4 changes: 2 additions & 2 deletions test/src/Grant/PasswordTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class PasswordTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
$this->provider = new \League\OAuth2\Client\Provider\Google(array(
'clientId' => 'mock_client_id',
'clientId' => 'mock_client_id',
'clientSecret' => 'mock_secret',
'redirectUri' => 'none',
'redirectUri' => 'none',
));
}

Expand Down
4 changes: 2 additions & 2 deletions test/src/Grant/RefreshTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class RefreshTokenTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
$this->provider = new \League\OAuth2\Client\Provider\Google([
'clientId' => 'mock_client_id',
'clientId' => 'mock_client_id',
'clientSecret' => 'mock_secret',
'redirectUri' => 'none',
'redirectUri' => 'none',
]);
}

Expand Down
24 changes: 12 additions & 12 deletions test/src/Provider/AbstractProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ class AbstractProviderTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
$this->provider = new \League\OAuth2\Client\Provider\Google([
'clientId' => 'mock_client_id',
'clientId' => 'mock_client_id',
'clientSecret' => 'mock_secret',
'redirectUri' => 'none',
'redirectUri' => 'none',
]);
}

Expand Down Expand Up @@ -58,17 +58,17 @@ public function testAuthorizationUrlStateParam()
public function testConstructorSetsProperties()
{
$options = [
'clientId' => '1234',
'clientSecret' => '4567',
'redirectUri' => 'http://example.org/redirect',
'state' => 'foo',
'name' => 'bar',
'uidKey' => 'mynewuid',
'scopes' => ['a', 'b', 'c'],
'method' => 'get',
'clientId' => '1234',
'clientSecret' => '4567',
'redirectUri' => 'http://example.org/redirect',
'state' => 'foo',
'name' => 'bar',
'uidKey' => 'mynewuid',
'scopes' => ['a', 'b', 'c'],
'method' => 'get',
'scopeSeparator' => ';',
'responseType' => 'csv',
'headers' => ['Foo' => 'Bar'],
'responseType' => 'csv',
'headers' => ['Foo' => 'Bar'],
];

$mockProvider = new MockProvider($options);
Expand Down
4 changes: 2 additions & 2 deletions test/src/Provider/EventbriteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class EventbriteTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
$this->provider = new \League\OAuth2\Client\Provider\Eventbrite([
'clientId' => 'mock_client_id',
'clientId' => 'mock_client_id',
'clientSecret' => 'mock_secret',
'redirectUri' => 'none',
'redirectUri' => 'none',
]);
}

Expand Down
4 changes: 2 additions & 2 deletions test/src/Provider/FacebookTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class FacebookTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
$this->provider = new \League\OAuth2\Client\Provider\Facebook([
'clientId' => 'mock_client_id',
'clientId' => 'mock_client_id',
'clientSecret' => 'mock_secret',
'redirectUri' => 'none',
'redirectUri' => 'none',
]);
}

Expand Down
4 changes: 2 additions & 2 deletions test/src/Provider/GithubTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class GithubTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
$this->provider = new \League\OAuth2\Client\Provider\Github([
'clientId' => 'mock',
'clientId' => 'mock',
'clientSecret' => 'mock_secret',
'redirectUri' => 'none',
'redirectUri' => 'none',
]);
}

Expand Down
4 changes: 2 additions & 2 deletions test/src/Provider/GoogleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class GoogleTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
$this->provider = new \League\OAuth2\Client\Provider\Google([
'clientId' => 'mock_client_id',
'clientId' => 'mock_client_id',
'clientSecret' => 'mock_secret',
'redirectUri' => 'none',
'redirectUri' => 'none',
'hostedDomain' => 'mock_domain',
]);
}
Expand Down
4 changes: 2 additions & 2 deletions test/src/Provider/InstagramTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class InstagramTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
$this->provider = new \League\OAuth2\Client\Provider\Instagram([
'clientId' => 'mock_client_id',
'clientId' => 'mock_client_id',
'clientSecret' => 'mock_secret',
'redirectUri' => 'none',
'redirectUri' => 'none',
]);
}

Expand Down
4 changes: 2 additions & 2 deletions test/src/Provider/LinkedInTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ class LinkedInTest extends \PHPUnit_Framework_TestCase
protected function setUp()
{
$this->provider = new \League\OAuth2\Client\Provider\LinkedIn([
'clientId' => 'mock_client_id',
'clientId' => 'mock_client_id',
'clientSecret' => 'mock_secret',
'redirectUri' => 'none',
'redirectUri' => 'none',
]);
}

Expand Down
Loading

0 comments on commit e862fce

Please sign in to comment.