Rework tests structure. Upgrade codeception to 2.5.3. Merge params configuration into app configuration.

This commit is contained in:
ErickSkrauch
2019-02-20 22:58:52 +03:00
parent 2eacc581be
commit b05dc6816e
248 changed files with 1503 additions and 1339 deletions

View File

@@ -0,0 +1,26 @@
<?php
return [
'components' => [
'user' => [
'secret' => 'tests-secret-key',
],
'reCaptcha' => [
'public' => 'public-key',
'secret' => 'private-key',
],
],
'params' => [
'authserverHost' => 'localhost',
],
'container' => [
'definitions' => [
api\components\ReCaptcha\Validator::class => function() {
return new class(new GuzzleHttp\Client()) extends api\components\ReCaptcha\Validator {
protected function validateValue($value) {
return null;
}
};
},
],
],
];

View File

@@ -1,15 +1,12 @@
<?php
$params = array_merge(
require __DIR__ . '/../../common/config/params.php',
require __DIR__ . '/params.php'
);
return [
'id' => 'accounts-site-api',
'basePath' => dirname(__DIR__),
'bootstrap' => ['log', 'authserver', 'internal'],
'bootstrap' => ['log', 'authserver', 'internal', 'mojang'],
'controllerNamespace' => 'api\controllers',
'params' => $params,
'params' => [
'authserverHost' => getenv('AUTHSERVER_HOST'),
],
'components' => [
'user' => [
'class' => api\components\User\Component::class,
@@ -79,10 +76,7 @@ return [
],
],
'modules' => [
'authserver' => [
'class' => api\modules\authserver\Module::class,
'host' => $params['authserverHost'],
],
'authserver' => api\modules\authserver\Module::class,
'session' => api\modules\session\Module::class,
'mojang' => api\modules\mojang\Module::class,
'internal' => api\modules\internal\Module::class,

View File

@@ -1,4 +0,0 @@
<?php
return [
'authserverHost' => getenv('AUTHSERVER_HOST'),
];

View File

@@ -1,7 +1,4 @@
<?php
/**
* @var array $params
*/
return [
// Oauth module routes
'/oauth2/v1/<action>' => 'oauth/authorization/<action>',
@@ -46,8 +43,4 @@ return [
'/mojang/profiles/<username>' => 'mojang/api/uuid-by-username',
'/mojang/profiles/<uuid>/names' => 'mojang/api/usernames-by-uuid',
'POST /mojang/profiles' => 'mojang/api/uuids-by-usernames',
"//{$params['authserverHost']}/mojang/api/users/profiles/minecraft/<username>" => 'mojang/api/uuid-by-username',
"//{$params['authserverHost']}/mojang/api/user/profiles/<uuid>/names" => 'mojang/api/usernames-by-uuid',
"POST //{$params['authserverHost']}/mojang/api/profiles/minecraft" => 'mojang/api/uuids-by-usernames',
];