mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-11-30 02:33:14 +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:
|
||||
- mkdir -p build/logs
|
||||
- phpunit --coverage-text
|
||||
- ./vendor/bin/codecept run api -d
|
||||
- ./vendor/bin/codecept run resourceServer -d
|
||||
- ./vendor/bin/phpcs src --standard=psr2
|
||||
|
||||
after_script:
|
||||
|
@ -4,7 +4,7 @@ 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
|
||||
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:
|
||||
enabled: [PhpBrowser, REST, ApiHelper]
|
||||
enabled: [PhpBrowser, REST, ResourceServerHelper]
|
||||
config:
|
||||
PhpBrowser:
|
||||
url: http://localhost:8000/
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
$I = new ApiTester($scenario);
|
||||
$I = new ResourceServerTester($scenario);
|
||||
$I->wantTo('get all users with all fields');
|
||||
$I->sendGET('api.php/users?access_token=iamgod');
|
||||
$I->seeResponseCodeIs(200);
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
$I = new ApiTester($scenario);
|
||||
$I = new ResourceServerTester($scenario);
|
||||
$I->wantTo('get all users with all basic and email fields');
|
||||
$I->sendGET('api.php/users?access_token=iamphil');
|
||||
$I->seeResponseCodeIs(200);
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
$I = new ApiTester($scenario);
|
||||
$I = new ResourceServerTester($scenario);
|
||||
$I->wantTo('get all users with basic and photo fields');
|
||||
$I->sendGET('api.php/users?access_token=iamalex');
|
||||
$I->seeResponseCodeIs(200);
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
$I = new ApiTester($scenario);
|
||||
$I = new ResourceServerTester($scenario);
|
||||
$I->wantTo('get all users with an invalid access token');
|
||||
$I->sendGET('api.php/users?access_token=foobar');
|
||||
$I->seeResponseCodeIs(401);
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
$I = new ApiTester($scenario);
|
||||
$I = new ResourceServerTester($scenario);
|
||||
$I->wantTo('get all users without an access token');
|
||||
$I->sendGET('api.php/users');
|
||||
$I->seeResponseCodeIs(400);
|
@ -1,5 +1,5 @@
|
||||
<?php
|
||||
$I = new ApiTester($scenario);
|
||||
$I = new ResourceServerTester($scenario);
|
||||
$I->wantTo('get all users with header access token');
|
||||
$I->haveHttpHeader('Authorization', 'Bearer iamgod');
|
||||
$I->sendGET('api.php/users');
|
@ -1,4 +1,4 @@
|
||||
<?php //[STAMP] babc0b91331536668c9382c85f4211e9
|
||||
<?php //[STAMP] f92301a37a718375eb6b8c5ac7f36d91
|
||||
|
||||
// This class was automatically generated by build task
|
||||
// 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\REST;
|
||||
use Codeception\Module\ApiHelper;
|
||||
use Codeception\Module\ResourceServerHelper;
|
||||
|
||||
/**
|
||||
* Inherited Methods
|
||||
@ -22,7 +22,7 @@ use Codeception\Module\ApiHelper;
|
||||
* @method void comment($description)
|
||||
* @method void haveFriend($name)
|
||||
*/
|
||||
class ApiTester extends \Codeception\Actor
|
||||
class ResourceServerTester extends \Codeception\Actor
|
||||
{
|
||||
|
||||
/**
|
Loading…
Reference in New Issue
Block a user