Code style improvements

oauth1test
Brooke Bryan 2014-12-15 18:17:29 +00:00
parent 85d88a449e
commit bc3845d9e5
2 changed files with 18 additions and 18 deletions

View File

@ -135,7 +135,7 @@ abstract class AbstractProvider implements ProviderInterface
} }
// @codeCoverageIgnoreStart // @codeCoverageIgnoreStart
public function authorize($options = array()) public function authorize($options = [])
{ {
$url = $this->getAuthorizationUrl($options); $url = $this->getAuthorizationUrl($options);
if ($this->redirectHandler) { if ($this->redirectHandler) {
@ -179,7 +179,7 @@ abstract class AbstractProvider implements ProviderInterface
// No providers included with this library use get but 3rd parties may // No providers included with this library use get but 3rd parties may
$client = $this->getHttpClient(); $client = $this->getHttpClient();
$client->setBaseUrl($this->urlAccessToken() . '?' . $this->httpBuildQuery($requestParams, '', '&')); $client->setBaseUrl($this->urlAccessToken() . '?' . $this->httpBuildQuery($requestParams, '', '&'));
$request = $client->get(null, null, $requestParams)->send(); $request = $client->get(null, null, $requestParams)->send();
$response = $request->getBody(); $response = $request->getBody();
break; break;
// @codeCoverageIgnoreEnd // @codeCoverageIgnoreEnd

View File

@ -4,7 +4,7 @@ namespace League\OAuth2\Client\Test\Provider;
use League\OAuth2\Client\Provider\AbstractProvider; use League\OAuth2\Client\Provider\AbstractProvider;
use League\OAuth2\Client\Token\AccessToken; use League\OAuth2\Client\Token\AccessToken;
use \Mockery as m; use Mockery as m;
class AbstractProviderTest extends \PHPUnit_Framework_TestCase class AbstractProviderTest extends \PHPUnit_Framework_TestCase
{ {
@ -103,14 +103,14 @@ class AbstractProviderTest extends \PHPUnit_Framework_TestCase
$token = new AccessToken(['access_token' => 'abc', 'expires_in' => 3600]); $token = new AccessToken(['access_token' => 'abc', 'expires_in' => 3600]);
$provider = $this->getMockForAbstractClass( $provider = $this->getMockForAbstractClass(
'\League\OAuth2\Client\Provider\AbstractProvider', '\League\OAuth2\Client\Provider\AbstractProvider',
[
[ [
'clientId' => 'mock_client_id', [
'clientSecret' => 'mock_secret', 'clientId' => 'mock_client_id',
'redirectUri' => 'none', 'clientSecret' => 'mock_secret',
'redirectUri' => 'none',
]
] ]
]
); );
/** /**
@ -124,22 +124,22 @@ class AbstractProviderTest extends \PHPUnit_Framework_TestCase
public function userPropertyProvider() public function userPropertyProvider()
{ {
$response = new \stdClass(); $response = new \stdClass();
$response->id = 1; $response->id = 1;
$response->email = 'test@example.com'; $response->email = 'test@example.com';
$response->name = 'test'; $response->name = 'test';
$response2 = new \stdClass(); $response2 = new \stdClass();
$response2->id = null; $response2->id = null;
$response2->email = null; $response2->email = null;
$response2->name = null; $response2->name = null;
$response3 = new \stdClass(); $response3 = new \stdClass();
return [ return [
[$response, 'test', 'test@example.com', 1], [$response, 'test', 'test@example.com', 1],
[$response2], [$response2],
[$response3], [$response3],
]; ];
} }
} }