mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-22 21:19:46 +05:30
Removed old codecept tests
This commit is contained in:
parent
64d4c4a38a
commit
9a8b7ec898
@ -1,10 +0,0 @@
|
||||
actor: Tester
|
||||
paths:
|
||||
tests: tests
|
||||
log: tests/_output
|
||||
data: tests/_data
|
||||
helpers: tests/_support
|
||||
settings:
|
||||
bootstrap: _bootstrap.php
|
||||
colors: true
|
||||
memory_limit: 1024M
|
@ -1,79 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace League\OAuth2\Server\Entities;
|
||||
|
||||
class AuthorizationCodeRequestEntity
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private $clientId;
|
||||
|
||||
/**
|
||||
* @var null|string
|
||||
*/
|
||||
private $redirectUri;
|
||||
|
||||
/**
|
||||
* @var null|string
|
||||
*/
|
||||
private $scope;
|
||||
|
||||
/**
|
||||
* @var null|string
|
||||
*/
|
||||
private $state;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getClientId()
|
||||
{
|
||||
return $this->clientId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|string
|
||||
*/
|
||||
public function getRedirectUri()
|
||||
{
|
||||
return $this->redirectUri;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|string
|
||||
*/
|
||||
public function getScope()
|
||||
{
|
||||
return $this->scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return null|string
|
||||
*/
|
||||
public function getState()
|
||||
{
|
||||
return $this->state;
|
||||
}
|
||||
|
||||
/**
|
||||
* AuthorizationCodeRequestEntity constructor.
|
||||
*
|
||||
* @param string $clientId
|
||||
* @param string|null $redirectUri
|
||||
* @param string|null $scope
|
||||
* @param string|null $state
|
||||
*/
|
||||
public function __construct($clientId, $redirectUri = null, $scope = null, $state = null)
|
||||
{
|
||||
$this->clientId = $clientId;
|
||||
$this->redirectUri = $redirectUri;
|
||||
$this->scope = $scope;
|
||||
$this->state = $state;
|
||||
}
|
||||
|
||||
public function __sleep()
|
||||
{
|
||||
return ['clientId', 'redirectUri', 'scope', 'state'];
|
||||
}
|
||||
}
|
0
tests/_output/.gitignore
vendored
0
tests/_output/.gitignore
vendored
@ -1,10 +0,0 @@
|
||||
<?php
|
||||
namespace Codeception\Module;
|
||||
|
||||
// here you can define custom actions
|
||||
// all public methods declared in helper class will be available in $I
|
||||
|
||||
class ApiHelper extends \Codeception\Module
|
||||
{
|
||||
|
||||
}
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
$I = new ApiTester($scenario);
|
||||
$I->wantTo('get an access token using the client credentials grant');
|
||||
$I->sendPOST(
|
||||
'client_credentials.php/access_token',
|
||||
[
|
||||
'grant_type' => 'client_credentials',
|
||||
'client_id' => 'myawesomeapp',
|
||||
'client_secret' => 'abc123',
|
||||
'scope' => 'basic'
|
||||
]
|
||||
);
|
||||
$I->canSeeResponseCodeIs(200);
|
||||
$I->canSeeResponseIsJson();
|
||||
$I->seeResponseJsonMatchesJsonPath('$.token_type');
|
||||
$I->seeResponseJsonMatchesJsonPath('$.expires_in');
|
||||
$I->seeResponseJsonMatchesJsonPath('$.access_token');
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
$I = new ApiTester($scenario);
|
||||
$I->wantTo('get an access token using the client credentials grant, invalid client id');
|
||||
$I->sendPOST(
|
||||
'client_credentials.php/access_token',
|
||||
[
|
||||
'grant_type' => 'client_credentials',
|
||||
'client_id' => 'myawesomeapp-wrong',
|
||||
'client_secret' => 'foobar'
|
||||
]
|
||||
);
|
||||
$I->canSeeResponseCodeIs(401);
|
||||
$I->canSeeResponseIsJson();
|
||||
$I->seeResponseContainsJson([
|
||||
'error' => 'invalid_client',
|
||||
'message' => 'Client authentication failed.'
|
||||
]);
|
@ -1,17 +0,0 @@
|
||||
<?php
|
||||
$I = new ApiTester($scenario);
|
||||
$I->wantTo('get an access token using the client credentials grant, invalid client secret');
|
||||
$I->sendPOST(
|
||||
'client_credentials.php/access_token',
|
||||
[
|
||||
'grant_type' => 'client_credentials',
|
||||
'client_id' => 'myawesomeapp',
|
||||
'client_secret' => 'foobar'
|
||||
]
|
||||
);
|
||||
$I->canSeeResponseCodeIs(401);
|
||||
$I->canSeeResponseIsJson();
|
||||
$I->seeResponseContainsJson([
|
||||
'error' => 'invalid_client',
|
||||
'message' => 'Client authentication failed.'
|
||||
]);
|
@ -1,15 +0,0 @@
|
||||
<?php
|
||||
$I = new ApiTester($scenario);
|
||||
$I->wantTo('get an access token using the client credentials grant, missing client id');
|
||||
$I->sendPOST(
|
||||
'client_credentials.php/access_token',
|
||||
[
|
||||
'grant_type' => 'client_credentials'
|
||||
]
|
||||
);
|
||||
$I->canSeeResponseCodeIs(400);
|
||||
$I->canSeeResponseIsJson();
|
||||
$I->seeResponseContainsJson([
|
||||
'error' => 'invalid_request',
|
||||
'message' => 'The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the "client_id" parameter.'
|
||||
]);
|
@ -1,16 +0,0 @@
|
||||
<?php
|
||||
$I = new ApiTester($scenario);
|
||||
$I->wantTo('get an access token using the client credentials grant, missing client secret');
|
||||
$I->sendPOST(
|
||||
'client_credentials.php/access_token',
|
||||
[
|
||||
'grant_type' => 'client_credentials',
|
||||
'client_id' => 'myawesomeapp'
|
||||
]
|
||||
);
|
||||
$I->canSeeResponseCodeIs(400);
|
||||
$I->canSeeResponseIsJson();
|
||||
$I->seeResponseContainsJson([
|
||||
'error' => 'invalid_request',
|
||||
'message' => 'The request is missing a required parameter, includes an invalid parameter value, includes a parameter more than once, or is otherwise malformed. Check the "client_secret" parameter.'
|
||||
]);
|
@ -1,2 +0,0 @@
|
||||
<?php
|
||||
// Here you can initialize variables that will be available to your tests
|
Loading…
Reference in New Issue
Block a user