diff --git a/.travis.yml b/.travis.yml index 4fcc7688..229989cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/tests/_support/ApiHelper.php b/tests/_support/AuthServerHelper.php similarity index 74% rename from tests/_support/ApiHelper.php rename to tests/_support/AuthServerHelper.php index 22b8bbfc..02792dda 100644 --- a/tests/_support/ApiHelper.php +++ b/tests/_support/AuthServerHelper.php @@ -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 { } \ No newline at end of file diff --git a/tests/_support/ResourceServerHelper.php b/tests/_support/ResourceServerHelper.php new file mode 100644 index 00000000..532b3e73 --- /dev/null +++ b/tests/_support/ResourceServerHelper.php @@ -0,0 +1,10 @@ +wantTo('get all users with all fields'); $I->sendGET('api.php/users?access_token=iamgod'); $I->seeResponseCodeIs(200); diff --git a/tests/api/GetUsersBasicEmailFieldsCept.php b/tests/resourceServer/GetUsersBasicEmailFieldsCept.php similarity index 92% rename from tests/api/GetUsersBasicEmailFieldsCept.php rename to tests/resourceServer/GetUsersBasicEmailFieldsCept.php index cb1211a8..d8e590be 100644 --- a/tests/api/GetUsersBasicEmailFieldsCept.php +++ b/tests/resourceServer/GetUsersBasicEmailFieldsCept.php @@ -1,5 +1,5 @@ wantTo('get all users with all basic and email fields'); $I->sendGET('api.php/users?access_token=iamphil'); $I->seeResponseCodeIs(200); diff --git a/tests/api/GetUsersBasicPhotoFieldsCept.php b/tests/resourceServer/GetUsersBasicPhotoFieldsCept.php similarity index 93% rename from tests/api/GetUsersBasicPhotoFieldsCept.php rename to tests/resourceServer/GetUsersBasicPhotoFieldsCept.php index 4ee082ea..fb13db23 100644 --- a/tests/api/GetUsersBasicPhotoFieldsCept.php +++ b/tests/resourceServer/GetUsersBasicPhotoFieldsCept.php @@ -1,5 +1,5 @@ wantTo('get all users with basic and photo fields'); $I->sendGET('api.php/users?access_token=iamalex'); $I->seeResponseCodeIs(200); diff --git a/tests/api/GetUsersInvalidTokenCept.php b/tests/resourceServer/GetUsersInvalidTokenCept.php similarity index 79% rename from tests/api/GetUsersInvalidTokenCept.php rename to tests/resourceServer/GetUsersInvalidTokenCept.php index e7192460..1dab7324 100644 --- a/tests/api/GetUsersInvalidTokenCept.php +++ b/tests/resourceServer/GetUsersInvalidTokenCept.php @@ -1,5 +1,5 @@ wantTo('get all users with an invalid access token'); $I->sendGET('api.php/users?access_token=foobar'); $I->seeResponseCodeIs(401); diff --git a/tests/api/GetUsersNoTokenCept.php b/tests/resourceServer/GetUsersNoTokenCept.php similarity index 77% rename from tests/api/GetUsersNoTokenCept.php rename to tests/resourceServer/GetUsersNoTokenCept.php index 93d25c81..9b7ae094 100644 --- a/tests/api/GetUsersNoTokenCept.php +++ b/tests/resourceServer/GetUsersNoTokenCept.php @@ -1,5 +1,5 @@ wantTo('get all users without an access token'); $I->sendGET('api.php/users'); $I->seeResponseCodeIs(400); diff --git a/tests/api/GetUsersTokenHeaderCept.php b/tests/resourceServer/GetUsersTokenHeaderCept.php similarity index 94% rename from tests/api/GetUsersTokenHeaderCept.php rename to tests/resourceServer/GetUsersTokenHeaderCept.php index 31473aba..82cbd226 100644 --- a/tests/api/GetUsersTokenHeaderCept.php +++ b/tests/resourceServer/GetUsersTokenHeaderCept.php @@ -1,5 +1,5 @@ wantTo('get all users with header access token'); $I->haveHttpHeader('Authorization', 'Bearer iamgod'); $I->sendGET('api.php/users'); diff --git a/tests/api/ApiTester.php b/tests/resourceServer/ResourceServerTester.php similarity index 99% rename from tests/api/ApiTester.php rename to tests/resourceServer/ResourceServerTester.php index 8fe6b1ff..7761fb68 100644 --- a/tests/api/ApiTester.php +++ b/tests/resourceServer/ResourceServerTester.php @@ -1,4 +1,4 @@ -