Automated formatting changes

This commit is contained in:
Formatter Bot 2020-10-06 12:28:10 +00:00
parent 77bbb3f7a7
commit 9406856e59
9 changed files with 61 additions and 61 deletions

View File

@ -23,7 +23,7 @@ class AuthorizationCodeTest extends \PHPUnit\Framework\TestCase
{
private AuthorizationCode $grant;
public function setUp() : void
protected function setUp() : void
{
$this->grant = new AuthorizationCode();
}
@ -33,17 +33,17 @@ class AuthorizationCodeTest extends \PHPUnit\Framework\TestCase
self::assertEquals('authorization_code', $this->grant->__toString());
self::assertEquals(
[
'code' => 'value',
'code' => 'value',
'option' => '2',
'test' => 'value2',
'test' => 'value2',
],
$this->grant->prepareRequestParamters(
[
'code' => 'value'
'code' => 'value',
],
[
'option' => '2',
'test' => 'value2'
'test' => 'value2',
]
)
);
@ -54,11 +54,11 @@ class AuthorizationCodeTest extends \PHPUnit\Framework\TestCase
$this->expectException(\Exception::class);
$this->grant->prepareRequestParamters(
[
'test' => 'value'
'test' => 'value',
],
[
'option' => '2',
'test' => 'value2'
'test' => 'value2',
]
);
}

View File

@ -23,7 +23,7 @@ class ClientCredentialsTest extends \PHPUnit\Framework\TestCase
{
private ClientCredentials $grant;
public function setUp() : void
protected function setUp() : void
{
$this->grant = new ClientCredentials();
}
@ -33,17 +33,17 @@ class ClientCredentialsTest extends \PHPUnit\Framework\TestCase
self::assertEquals('client_credentials', $this->grant->__toString());
self::assertEquals(
[
'code' => 'value',
'code' => 'value',
'option' => '2',
'test' => 'value2',
'test' => 'value2',
],
$this->grant->prepareRequestParamters(
[
'code' => 'value'
'code' => 'value',
],
[
'option' => '2',
'test' => 'value2'
'test' => 'value2',
]
)
);

View File

@ -23,9 +23,9 @@ class GrantAbstractTest extends \PHPUnit\Framework\TestCase
{
private GrantAbstract $grant;
public function setUp() : void
protected function setUp() : void
{
$this->grant = new class extends GrantAbstract {
$this->grant = new class() extends GrantAbstract {
protected function getName() : string
{
return 'TestGrant';
@ -43,16 +43,16 @@ class GrantAbstractTest extends \PHPUnit\Framework\TestCase
self::assertEquals('TestGrant', $this->grant->__toString());
self::assertEquals(
[
'test' => 'value2',
'option' => '2'
'test' => 'value2',
'option' => '2',
],
$this->grant->prepareRequestParamters(
[
'test' => 'value'
'test' => 'value',
],
[
'option' => '2',
'test' => 'value2'
'test' => 'value2',
]
)
);
@ -63,7 +63,7 @@ class GrantAbstractTest extends \PHPUnit\Framework\TestCase
$this->expectException(\Exception::class);
$this->grant->prepareRequestParamters(
[
'something' => 'value'
'something' => 'value',
],
[
'option' => '2',

View File

@ -15,8 +15,8 @@ declare(strict_types=1);
namespace phpOMS\tests\Auth\OAuth2\Grant;
use phpOMS\Auth\OAuth2\Grant\AuthorizationCode;
use phpOMS\Auth\OAuth2\Grant\GrantFactory;
use phpOMS\Auth\OAuth2\Grant\GrantAbstract;
use phpOMS\Auth\OAuth2\Grant\GrantFactory;
/**
* @internal
@ -25,7 +25,7 @@ class GrantFactoryTest extends \PHPUnit\Framework\TestCase
{
private GrantFactory $factory;
public function setUp() : void
protected function setUp() : void
{
$this->factory = new GrantFactory();
}
@ -38,7 +38,7 @@ class GrantFactoryTest extends \PHPUnit\Framework\TestCase
public function testGrantInputOutput() : void
{
$grant = new class extends GrantAbstract {
$grant = new class() extends GrantAbstract {
protected function getName() : string
{
return 'TestGrant';

View File

@ -23,7 +23,7 @@ class PasswordTest extends \PHPUnit\Framework\TestCase
{
private Password $grant;
public function setUp() : void
protected function setUp() : void
{
$this->grant = new Password();
}
@ -35,15 +35,15 @@ class PasswordTest extends \PHPUnit\Framework\TestCase
[
'username' => 'value',
'password' => '2',
'test' => 'value2',
'test' => 'value2',
],
$this->grant->prepareRequestParamters(
[
'username' => 'value'
'username' => 'value',
],
[
'password' => '2',
'test' => 'value2'
'test' => 'value2',
]
)
);
@ -54,11 +54,11 @@ class PasswordTest extends \PHPUnit\Framework\TestCase
$this->expectException(\Exception::class);
$this->grant->prepareRequestParamters(
[
'username' => 'value'
'username' => 'value',
],
[
'option' => '2',
'test' => 'value2'
'test' => 'value2',
]
);
}

View File

@ -23,7 +23,7 @@ class RefreshTokenTest extends \PHPUnit\Framework\TestCase
{
private RefreshToken $grant;
public function setUp() : void
protected function setUp() : void
{
$this->grant = new RefreshToken();
}
@ -34,16 +34,16 @@ class RefreshTokenTest extends \PHPUnit\Framework\TestCase
self::assertEquals(
[
'refresh_token' => 'value',
'option' => '2',
'test' => 'value2',
'option' => '2',
'test' => 'value2',
],
$this->grant->prepareRequestParamters(
[
'refresh_token' => 'value'
'refresh_token' => 'value',
],
[
'option' => '2',
'test' => 'value2'
'test' => 'value2',
]
)
);
@ -54,11 +54,11 @@ class RefreshTokenTest extends \PHPUnit\Framework\TestCase
$this->expectException(\Exception::class);
$this->grant->prepareRequestParamters(
[
'test' => 'value'
'test' => 'value',
],
[
'option' => '2',
'test' => 'value2'
'test' => 'value2',
]
);
}

View File

@ -25,7 +25,7 @@ class HttpBasicAuthOptionProviderTest extends \PHPUnit\Framework\TestCase
{
private HttpBasicAuthOptionProvider $provider;
public function setUp() : void
protected function setUp() : void
{
$this->provider = new HttpBasicAuthOptionProvider();
}
@ -35,16 +35,16 @@ class HttpBasicAuthOptionProviderTest extends \PHPUnit\Framework\TestCase
self::assertEquals(
[
'headers' => [
'content-type' => MimeType::M_POST,
'Authorization' => 'Basic aWQ6c2VjcmV0'
'content-type' => MimeType::M_POST,
'Authorization' => 'Basic aWQ6c2VjcmV0',
],
'body' => 'para=test&para2=test2',
],
$this->provider->getAccessTokenOptions(RequestMethod::POST, [
'para' => 'test',
'para2' => 'test2',
'client_id' => 'id',
'client_secret' => 'secret'
'para' => 'test',
'para2' => 'test2',
'client_id' => 'id',
'client_secret' => 'secret',
]
)
);
@ -54,8 +54,8 @@ class HttpBasicAuthOptionProviderTest extends \PHPUnit\Framework\TestCase
{
self::assertEquals([],
$this->provider->getAccessTokenOptions(RequestMethod::POST, [
'para' => 'test',
'para2' => 'test2',
'para' => 'test',
'para2' => 'test2',
'client_id' => 'id',
]
)

View File

@ -25,7 +25,7 @@ class PostAuthOptionProviderTest extends \PHPUnit\Framework\TestCase
{
private PostAuthOptionProvider $provider;
public function setUp() : void
protected function setUp() : void
{
$this->provider = new PostAuthOptionProvider();
}
@ -35,7 +35,7 @@ class PostAuthOptionProviderTest extends \PHPUnit\Framework\TestCase
self::assertEquals(
[
'headers' => ['content-type' => MimeType::M_POST],
'body' => 'para=test&para2=test2',
'body' => 'para=test&para2=test2',
],
$this->provider->getAccessTokenOptions(RequestMethod::POST, ['para' => 'test', 'para2' => 'test2'])
);

View File

@ -27,9 +27,9 @@ class AccessTokenTest extends \PHPUnit\Framework\TestCase
self::assertEquals('token', $token->getToken());
self::assertEquals('token', $token->__toString());
self::assertEquals(-1, $token->getExpires());
self::assertEquals(null, $token->getRefreshToken());
self::assertEquals(null, $token->getResourceOwnerId());
self::assertEquals(false, $token->hasExpired());
self::assertNull($token->getRefreshToken());
self::assertNull($token->getResourceOwnerId());
self::assertFalse($token->hasExpired());
self::assertEquals([], $token->getValues());
self::assertEquals(['access_token' => 'token'], $token->jsonSerialize());
}
@ -74,11 +74,11 @@ class AccessTokenTest extends \PHPUnit\Framework\TestCase
public function testValuesInputOutput() : void
{
$token = new AccessToken([
'access_token' => 'token',
'access_token' => 'token',
'resource_owner_id' => 'owner',
'expires_in' => 10,
'refresh_token' => 'refresh',
'more' => 'values'
'expires_in' => 10,
'refresh_token' => 'refresh',
'more' => 'values',
]);
self::assertEquals(
@ -92,20 +92,20 @@ class AccessTokenTest extends \PHPUnit\Framework\TestCase
$expires = \time() + 10;
$token = new AccessToken([
'access_token' => 'token',
'access_token' => 'token',
'resource_owner_id' => 'owner',
'expires' => $expires,
'refresh_token' => 'refresh',
'more' => 'values'
'expires' => $expires,
'refresh_token' => 'refresh',
'more' => 'values',
]);
self::assertEquals(
[
'access_token' => 'token',
'access_token' => 'token',
'resource_owner_id' => 'owner',
'expires' => $expires,
'refresh_token' => 'refresh',
'more' => 'values'
'expires' => $expires,
'refresh_token' => 'refresh',
'more' => 'values',
],
$token->jsonSerialize()
);