mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-02 11:40:47 +05:30
Moved existing functional tests into resource server folder
This commit is contained in:
parent
47a5c1ba08
commit
395ee3bf49
@ -23,7 +23,7 @@ before_script:
|
|||||||
script:
|
script:
|
||||||
- mkdir -p build/logs
|
- mkdir -p build/logs
|
||||||
- phpunit --coverage-text
|
- phpunit --coverage-text
|
||||||
- ./vendor/bin/codecept run api -d
|
- ./vendor/bin/codecept run resourceServer -d
|
||||||
- ./vendor/bin/phpcs src --standard=psr2
|
- ./vendor/bin/phpcs src --standard=psr2
|
||||||
|
|
||||||
after_script:
|
after_script:
|
||||||
|
@ -4,7 +4,7 @@ namespace Codeception\Module;
|
|||||||
// here you can define custom actions
|
// here you can define custom actions
|
||||||
// all public methods declared in helper class will be available in $I
|
// all public methods declared in helper class will be available in $I
|
||||||
|
|
||||||
class ApiHelper extends \Codeception\Module
|
class AuthServerHelper extends \Codeception\Module
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
10
tests/_support/ResourceServerHelper.php
Normal file
10
tests/_support/ResourceServerHelper.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<?php
|
||||||
|
namespace Codeception\Module;
|
||||||
|
|
||||||
|
// here you can define custom actions
|
||||||
|
// all public methods declared in helper class will be available in $I
|
||||||
|
|
||||||
|
class ResourceServerHelper extends \Codeception\Module
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
class_name: ApiTester
|
class_name: ResourceServerTester
|
||||||
modules:
|
modules:
|
||||||
enabled: [PhpBrowser, REST, ApiHelper]
|
enabled: [PhpBrowser, REST, ResourceServerHelper]
|
||||||
config:
|
config:
|
||||||
PhpBrowser:
|
PhpBrowser:
|
||||||
url: http://localhost:8000/
|
url: http://localhost:8000/
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
$I = new ApiTester($scenario);
|
$I = new ResourceServerTester($scenario);
|
||||||
$I->wantTo('get all users with all fields');
|
$I->wantTo('get all users with all fields');
|
||||||
$I->sendGET('api.php/users?access_token=iamgod');
|
$I->sendGET('api.php/users?access_token=iamgod');
|
||||||
$I->seeResponseCodeIs(200);
|
$I->seeResponseCodeIs(200);
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
$I = new ApiTester($scenario);
|
$I = new ResourceServerTester($scenario);
|
||||||
$I->wantTo('get all users with all basic and email fields');
|
$I->wantTo('get all users with all basic and email fields');
|
||||||
$I->sendGET('api.php/users?access_token=iamphil');
|
$I->sendGET('api.php/users?access_token=iamphil');
|
||||||
$I->seeResponseCodeIs(200);
|
$I->seeResponseCodeIs(200);
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
$I = new ApiTester($scenario);
|
$I = new ResourceServerTester($scenario);
|
||||||
$I->wantTo('get all users with basic and photo fields');
|
$I->wantTo('get all users with basic and photo fields');
|
||||||
$I->sendGET('api.php/users?access_token=iamalex');
|
$I->sendGET('api.php/users?access_token=iamalex');
|
||||||
$I->seeResponseCodeIs(200);
|
$I->seeResponseCodeIs(200);
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
$I = new ApiTester($scenario);
|
$I = new ResourceServerTester($scenario);
|
||||||
$I->wantTo('get all users with an invalid access token');
|
$I->wantTo('get all users with an invalid access token');
|
||||||
$I->sendGET('api.php/users?access_token=foobar');
|
$I->sendGET('api.php/users?access_token=foobar');
|
||||||
$I->seeResponseCodeIs(401);
|
$I->seeResponseCodeIs(401);
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
$I = new ApiTester($scenario);
|
$I = new ResourceServerTester($scenario);
|
||||||
$I->wantTo('get all users without an access token');
|
$I->wantTo('get all users without an access token');
|
||||||
$I->sendGET('api.php/users');
|
$I->sendGET('api.php/users');
|
||||||
$I->seeResponseCodeIs(400);
|
$I->seeResponseCodeIs(400);
|
@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
$I = new ApiTester($scenario);
|
$I = new ResourceServerTester($scenario);
|
||||||
$I->wantTo('get all users with header access token');
|
$I->wantTo('get all users with header access token');
|
||||||
$I->haveHttpHeader('Authorization', 'Bearer iamgod');
|
$I->haveHttpHeader('Authorization', 'Bearer iamgod');
|
||||||
$I->sendGET('api.php/users');
|
$I->sendGET('api.php/users');
|
@ -1,4 +1,4 @@
|
|||||||
<?php //[STAMP] babc0b91331536668c9382c85f4211e9
|
<?php //[STAMP] f92301a37a718375eb6b8c5ac7f36d91
|
||||||
|
|
||||||
// This class was automatically generated by build task
|
// This class was automatically generated by build task
|
||||||
// You should not change it manually as it will be overwritten on next build
|
// You should not change it manually as it will be overwritten on next build
|
||||||
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
use Codeception\Module\PhpBrowser;
|
use Codeception\Module\PhpBrowser;
|
||||||
use Codeception\Module\REST;
|
use Codeception\Module\REST;
|
||||||
use Codeception\Module\ApiHelper;
|
use Codeception\Module\ResourceServerHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Inherited Methods
|
* Inherited Methods
|
||||||
@ -22,7 +22,7 @@ use Codeception\Module\ApiHelper;
|
|||||||
* @method void comment($description)
|
* @method void comment($description)
|
||||||
* @method void haveFriend($name)
|
* @method void haveFriend($name)
|
||||||
*/
|
*/
|
||||||
class ApiTester extends \Codeception\Actor
|
class ResourceServerTester extends \Codeception\Actor
|
||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
Loading…
Reference in New Issue
Block a user