From 3646bfcb643b25fa0e1307aa8a61e5b2914b75ed Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Sun, 11 Nov 2018 13:48:23 +0300 Subject: [PATCH 1/7] Fixes ACCOUNTS-54A. Include deleted applications in the lookup for exists applications. --- api/modules/oauth/models/OauthClientForm.php | 5 ++++- .../api/functional/oauth/CreateClientCest.php | 19 +++++++++++++++++++ .../common/fixtures/data/oauth-clients.php | 2 +- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/api/modules/oauth/models/OauthClientForm.php b/api/modules/oauth/models/OauthClientForm.php index 8321a22..683e414 100644 --- a/api/modules/oauth/models/OauthClientForm.php +++ b/api/modules/oauth/models/OauthClientForm.php @@ -90,7 +90,10 @@ class OauthClientForm { } protected function isClientExists(string $id): bool { - return OauthClient::find()->andWhere(['id' => $id])->exists(); + return OauthClient::find() + ->includeDeleted() + ->andWhere(['id' => $id]) + ->exists(); } } diff --git a/tests/codeception/api/functional/oauth/CreateClientCest.php b/tests/codeception/api/functional/oauth/CreateClientCest.php index 665367f..ce483d4 100644 --- a/tests/codeception/api/functional/oauth/CreateClientCest.php +++ b/tests/codeception/api/functional/oauth/CreateClientCest.php @@ -88,4 +88,23 @@ class CreateClientCest { $I->canSeeResponseJsonMatchesJsonPath('$.data.createdAt'); } + public function testCreateApplicationWithTheSameNameAsDeletedApp(FunctionalTester $I) { + $I->wantTo('create application with the same name as the recently deleted application'); + $I->amAuthenticated('admin'); + $this->route->createClient('application', [ + 'name' => 'Deleted OAuth Client', + 'description' => '', + 'redirectUri' => 'http://some-site.com/oauth/ely', + 'websiteUrl' => 'http://some-site.com', + ]); + $I->canSeeResponseCodeIs(200); + $I->canSeeResponseIsJson(); + $I->canSeeResponseContainsJson([ + 'success' => true, + 'data' => [ + 'clientId' => 'deleted-oauth-client1', + ], + ]); + } + } diff --git a/tests/codeception/common/fixtures/data/oauth-clients.php b/tests/codeception/common/fixtures/data/oauth-clients.php index df4da2c..02ec7e3 100644 --- a/tests/codeception/common/fixtures/data/oauth-clients.php +++ b/tests/codeception/common/fixtures/data/oauth-clients.php @@ -116,7 +116,7 @@ return [ 'id' => 'deleted-oauth-client', 'secret' => 'YISLDvIHlLbhsvYoIJScUzTURVXK32Q58sHWSFKyO71iCIlv4YM2Zt1kEK7DQLXX', 'type' => 'application', - 'name' => 'I was deleted :(', + 'name' => 'Deleted OAuth Client', 'description' => null, 'redirect_uri' => 'http://not-exists-site.com/oauth/ely', 'website_url' => '', From 918501da813c1b614250561a964ae5837c6d574e Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Thu, 24 Jan 2019 19:29:46 +0300 Subject: [PATCH 2/7] Implemented the ability to get information about the current account by 0 id --- .../controllers/DefaultController.php | 16 +++++++++----- .../api/functional/accounts/GetCest.php | 22 +++++++++++++++++++ 2 files changed, 33 insertions(+), 5 deletions(-) diff --git a/api/modules/accounts/controllers/DefaultController.php b/api/modules/accounts/controllers/DefaultController.php index cc7bcb9..b9ac258 100644 --- a/api/modules/accounts/controllers/DefaultController.php +++ b/api/modules/accounts/controllers/DefaultController.php @@ -15,9 +15,9 @@ use yii\web\NotFoundHttpException; class DefaultController extends Controller { public function behaviors(): array { - $paramsCallback = function() { - $id = Yii::$app->request->get('id'); - if ($id === null) { + $paramsCallback = function(): array { + $id = (int)Yii::$app->request->get('id'); + if ($id === 0) { $identity = Yii::$app->user->getIdentity(); if ($identity !== null) { $account = $identity->getAccount(); @@ -132,7 +132,7 @@ class DefaultController extends Controller { return (new TwoFactorAuthInfo($this->findAccount($id)))->getCredentials(); } - public function bindActionParams($action, $params) { + public function bindActionParams($action, $params): array { if (!isset($params['id'])) { /** @noinspection NullPointerExceptionInspection */ $account = Yii::$app->user->getIdentity()->getAccount(); @@ -145,7 +145,13 @@ class DefaultController extends Controller { } private function findAccount(int $id): Account { - $account = Account::findOne($id); + if ($id === 0) { + /** @noinspection NullPointerExceptionInspection */ + $account = Yii::$app->user->getIdentity()->getAccount(); + } else { + $account = Account::findOne($id); + } + if ($account === null) { throw new NotFoundHttpException(); } diff --git a/tests/codeception/api/functional/accounts/GetCest.php b/tests/codeception/api/functional/accounts/GetCest.php index 4dfaaeb..c68e1e1 100644 --- a/tests/codeception/api/functional/accounts/GetCest.php +++ b/tests/codeception/api/functional/accounts/GetCest.php @@ -36,6 +36,28 @@ class GetCest { $I->canSeeResponseJsonMatchesJsonPath('$.passwordChangedAt'); } + public function testGetInfoAboutCurrentUser(FunctionalTester $I) { + $I->wantTo('get info about user with 0 id, e.g. current'); + $I->amAuthenticated(); + + $this->route->get(0); + $I->canSeeResponseCodeIs(200); + $I->canSeeResponseIsJson(); + $I->canSeeResponseContainsJson([ + 'id' => 1, + 'uuid' => 'df936908-b2e1-544d-96f8-2977ec213022', + 'username' => 'Admin', + 'isOtpEnabled' => false, + 'email' => 'admin@ely.by', + 'lang' => 'en', + 'isActive' => true, + 'hasMojangUsernameCollision' => false, + 'shouldAcceptRules' => false, + 'elyProfileLink' => 'http://ely.by/u1', + ]); + $I->canSeeResponseJsonMatchesJsonPath('$.passwordChangedAt'); + } + public function testGetWithNotAcceptedLatestRules(FunctionalTester $I) { $accountId = $I->amAuthenticated('Veleyaba'); From b05dc6816e16a484fe679a20328144703d52b2c0 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Wed, 20 Feb 2019 22:58:52 +0300 Subject: [PATCH 3/7] Rework tests structure. Upgrade codeception to 2.5.3. Merge params configuration into app configuration. --- .gitignore | 4 + api/codeception.dist.yml | 26 + .../config.php => api/config/config-test.php | 14 +- api/config/config.php | 16 +- api/config/params.php | 4 - api/config/routes.php | 7 - api/modules/authserver/Module.php | 22 +- api/modules/mojang/Module.php | 18 +- .../controllers/AuthorizationController.php | 5 +- api/tests/.gitignore | 3 + api/tests/_bootstrap.php | 10 + .../tests}/_output/.gitignore | 0 .../tests}/_pages/AccountsRoute.php | 28 +- .../tests}/_pages/AuthenticationRoute.php | 12 +- api/tests/_pages/AuthserverRoute.php | 26 + .../api => api/tests}/_pages/BasePage.php | 4 +- api/tests/_pages/IdentityInfoRoute.php | 10 + api/tests/_pages/InternalRoute.php | 10 + .../tests}/_pages/MojangApiRoute.php | 8 +- api/tests/_pages/OauthRoute.php | 42 ++ api/tests/_pages/OptionsRoute.php | 10 + api/tests/_pages/SessionServerRoute.php | 26 + .../api => api/tests}/_pages/SignupRoute.php | 8 +- .../tests}/_support/FunctionalTester.php | 27 +- api/tests/_support/UnitTester.php | 12 + api/tests/config/functional.php | 8 + api/tests/config/unit.php | 8 + api/tests/functional.suite.dist.yml | 20 + .../functional/EmailConfirmationCest.php | 5 +- .../tests}/functional/FeedbackCest.php | 8 +- .../tests}/functional/ForgotPasswordCest.php | 6 +- .../tests}/functional/LoginCest.php | 5 +- .../tests}/functional/LogoutCest.php | 5 +- .../tests}/functional/OptionsCest.php | 6 +- .../tests}/functional/RecoverPasswordCest.php | 8 +- .../tests}/functional/RefreshTokenCest.php | 6 +- .../tests}/functional/RegisterCest.php | 6 +- .../RepeatAccountActivationCest.php | 6 +- .../tests}/functional/_bootstrap.php | 0 .../functional/_steps/AuthserverSteps.php | 10 +- .../tests}/functional/_steps/OauthSteps.php | 6 +- .../functional/_steps/SessionServerSteps.php | 6 +- .../functional/accounts/AcceptRulesCest.php | 6 +- .../tests}/functional/accounts/BanCest.php | 8 +- .../ChangeEmailConfirmNewEmailCest.php | 6 +- .../accounts/ChangeEmailInitializeCest.php | 6 +- .../ChangeEmailSubmitNewEmailCest.php | 8 +- .../functional/accounts/ChangeLangCest.php | 6 +- .../accounts/ChangePasswordCest.php | 10 +- .../accounts/ChangeUsernameCest.php | 8 +- .../accounts/DisableTwoFactorAuthCest.php | 6 +- .../accounts/EnableTwoFactorAuthCest.php | 6 +- .../tests}/functional/accounts/GetCest.php | 6 +- .../tests}/functional/accounts/PardonCest.php | 8 +- .../accounts/TwoFactorAuthCredentialsCest.php | 6 +- .../authserver/AuthorizationCest.php | 6 +- .../functional/authserver/InvalidateCest.php | 6 +- .../functional/authserver/RefreshCest.php | 6 +- .../functional/authserver/SignoutCest.php | 6 +- .../functional/authserver/ValidateCest.php | 6 +- .../tests}/functional/internal/InfoCest.php | 8 +- .../functional/mojang/UsernameToUuidCest.php | 6 +- .../mojang/UsernamesToUuidsCest.php | 6 +- .../mojang/UuidToUsernamesHistoryCest.php | 6 +- .../functional/oauth/AccessTokenCest.php | 9 +- .../tests}/functional/oauth/AuthCodeCest.php | 6 +- .../oauth/ClientCredentialsCest.php | 8 +- .../functional/oauth/CreateClientCest.php | 6 +- .../functional/oauth/DeleteClientCest.php | 6 +- .../functional/oauth/GetClientsCest.php | 6 +- .../functional/oauth}/IdentityInfoCest.php | 22 +- .../functional/oauth/RefreshTokenCest.php | 8 +- .../functional/oauth/ResetClientCest.php | 6 +- .../functional/oauth/UpdateClientCest.php | 6 +- .../sessionserver/HasJoinedCest.php | 8 +- .../sessionserver/HasJoinedLegacyCest.php | 8 +- .../functional/sessionserver/JoinCest.php | 10 +- .../sessionserver/JoinLegacyCest.php | 10 +- .../functional/sessionserver/ProfileCest.php | 8 +- api/tests/unit.suite.dist.yml | 10 + .../api => api/tests}/unit/TestCase.php | 4 +- .../api => api/tests}/unit/_bootstrap.php | 0 .../components/ReCaptcha/ValidatorTest.php | 2 +- .../unit/components/User/ComponentTest.php | 10 +- .../User/JwtAuthenticationResultTest.php | 4 +- .../tests}/unit/filters/NginxCacheTest.php | 4 +- .../tests}/unit/models/FeedbackFormTest.php | 2 +- .../tests}/unit/models/JwtIdentityTest.php | 6 +- .../authentication/ConfirmEmailFormTest.php | 6 +- .../authentication/ForgotPasswordFormTest.php | 6 +- .../models/authentication/LoginFormTest.php | 6 +- .../models/authentication/LogoutFormTest.php | 4 +- .../RecoverPasswordFormTest.php | 6 +- .../authentication/RefreshTokenFormTest.php | 4 +- .../authentication/RegistrationFormTest.php | 17 +- .../RepeatAccountActivationFormTest.php | 8 +- .../tests}/unit/models/base/ApiFormTest.php | 4 +- .../models/profile/TwoFactorAuthFormTest.php | 0 .../accounts/models/AcceptRulesFormTest.php | 4 +- .../accounts/models/ChangeEmailFormTest.php | 8 +- .../models/ChangeLanguageFormTest.php | 4 +- .../models/ChangePasswordFormTest.php | 4 +- .../models/ChangeUsernameFormTest.php | 8 +- .../models/DisableTwoFactorAuthFormTest.php | 4 +- .../models/EnableTwoFactorAuthFormTest.php | 4 +- .../models/SendEmailVerificationFormTest.php | 8 +- .../SendNewEmailVerificationFormTest.php | 10 +- .../accounts/models/TwoFactorAuthInfoTest.php | 4 +- .../models/AuthenticationFormTest.php | 8 +- .../validators/RequiredValidatorTest.php | 4 +- .../modules/internal/models/BanFormTest.php | 4 +- .../internal/models/PardonFormTest.php | 4 +- .../oauth/models/ApplicationTypeTest.php | 4 +- .../oauth/models/BaseOauthClientTypeTest.php | 4 +- .../oauth/models/MinecraftServerTypeTest.php | 4 +- .../models/OauthClientFormFactoryTest.php | 4 +- .../oauth/models/OauthClientFormTest.php | 4 +- .../session/filters/RateLimiterTest.php | 46 +- .../tests}/unit/request/RequestParserTest.php | 4 +- .../tests}/unit/traits/AccountFinderTest.php | 6 +- .../EmailActivationKeyValidatorTest.php | 6 +- .../PasswordRequiredValidatorTest.php | 4 +- .../unit/validators/TotpValidatorTest.php | 6 +- api/web/index.php | 1 - codeception.dist.yml | 10 + common/codeception.dist.yml | 21 + common/config/ConfigLoader.php | 2 + common/config/bootstrap.php | 5 +- common/config/config-test.php | 23 + common/config/config.php | 27 +- common/config/params.php | 5 - common/tests/.gitignore | 2 + common/tests/_bootstrap.php | 8 + .../api => common/tests}/_output/.gitignore | 0 .../tests/_support/ApplicationRedisBridge.php | 33 ++ .../tests}/_support/FixtureHelper.php | 16 +- .../tests}/_support/Mockery.php | 2 +- .../tests}/_support/ProtectedCaller.php | 2 +- .../tests}/_support/UnitTester.php | 2 +- .../_support/queue/CodeceptionQueueHelper.php | 2 +- .../tests}/_support/queue/Queue.php | 2 +- common/tests/config/unit.php | 8 + .../tests}/fixtures/AccountFixture.php | 4 +- .../tests}/fixtures/AccountSessionFixture.php | 4 +- .../fixtures/EmailActivationFixture.php | 4 +- .../fixtures/MinecraftAccessKeyFixture.php | 4 +- .../tests}/fixtures/MojangUsernameFixture.php | 4 +- .../tests}/fixtures/OauthClientFixture.php | 4 +- .../tests}/fixtures/OauthSessionFixture.php | 4 +- .../fixtures/UsernameHistoryFixture.php | 4 +- .../tests}/fixtures/WebHooksEventsFixture.php | 4 +- .../tests}/fixtures/WebHooksFixture.php | 4 +- .../tests}/fixtures/data/account-sessions.php | 0 .../tests}/fixtures/data/accounts.php | 0 .../fixtures/data/email-activations.php | 0 .../fixtures/data/minecraft-access-keys.php | 0 .../tests}/fixtures/data/mojang-usernames.php | 0 .../tests}/fixtures/data/oauth-clients.php | 0 .../tests}/fixtures/data/oauth-sessions.php | 0 .../fixtures/data/usernames-history.php | 0 .../tests}/fixtures/data/webhooks-events.php | 0 .../tests}/fixtures/data/webhooks.php | 0 .../common => common/tests}/helpers/Mock.php | 2 +- .../tests}/templates/fixtures/account.php | 0 common/tests/unit.suite.dist.yml | 9 + .../common => common/tests}/unit/TestCase.php | 4 +- .../tests}/unit/_bootstrap.php | 0 .../unit/behaviors/DataBehaviorTest.php | 6 +- .../EmailActivationExpirationBehaviorTest.php | 6 +- .../behaviors/PrimaryKeyValueBehaviorTest.php | 4 +- .../tests}/unit/components/Mojang/ApiTest.php | 4 +- .../tests}/unit/db/mysql/QueryBuilderTest.php | 4 +- .../tests}/unit/emails/EmailHelperTest.php | 4 +- .../tests}/unit/emails/TemplateTest.php | 6 +- .../unit/emails/TemplateWithRendererTest.php | 6 +- .../tests}/unit/helpers/StringHelperTest.php | 5 +- .../tests}/unit/models/AccountSessionTest.php | 4 +- .../tests}/unit/models/AccountTest.php | 6 +- .../unit/models/EmailActivationTest.php | 6 +- .../unit/models/OauthClientQueryTest.php | 6 +- .../unit/rbac/rules/AccountOwnerTest.php | 4 +- .../unit/rbac/rules/OauthClientOwnerTest.php | 6 +- .../unit/tasks/ClearAccountSessionsTest.php | 6 +- .../unit/tasks/ClearOauthSessionsTest.php | 6 +- .../tasks/CreateWebHooksDeliveriesTest.php | 6 +- .../tests}/unit/tasks/DeliveryWebHookTest.php | 4 +- .../unit/tasks/PullMojangUsernameTest.php | 6 +- .../SendCurrentEmailConfirmationTest.php | 4 +- .../tasks/SendNewEmailConfirmationTest.php | 4 +- .../tasks/SendPasswordRecoveryEmailTest.php | 4 +- .../unit/tasks/SendRegistrationEmailTest.php | 4 +- .../unit/validators/EmailValidatorTest.php | 8 +- .../unit/validators/LanguageValidatorTest.php | 4 +- .../MinecraftServerAddressValidatorTest.php | 4 +- .../unit/validators/UsernameValidatorTest.php | 6 +- .../unit/validators/UuidValidatorTest.php | 4 +- composer.json | 20 +- composer.lock | 518 +++++++++++++----- console/codeception.dist.yml | 23 + console/config/config.php | 6 - console/config/params.php | 3 - console/tests/.gitignore | 2 + console/tests/_bootstrap.php | 10 + .../tests}/_output/.gitignore | 0 console/tests/_support/UnitTester.php | 12 + console/tests/config/unit.php | 8 + console/tests/unit.suite.dist.yml | 8 + .../tests}/unit/TestCase.php | 16 +- console/tests/unit/_bootstrap.php | 1 + .../controllers/CleanupControllerTest.php | 10 +- docker-compose.dev.yml | 198 ++++--- docker-compose.prod.yml | 97 ++-- tests/.gitignore | 1 - tests/codeception.yml | 10 - tests/codeception/api/.gitignore | 2 - tests/codeception/api/_bootstrap.php | 23 - .../api/_pages/AuthserverRoute.php | 26 - .../api/_pages/IdentityInfoRoute.php | 10 - .../codeception/api/_pages/InternalRoute.php | 10 - tests/codeception/api/_pages/OauthRoute.php | 42 -- tests/codeception/api/_pages/OptionsRoute.php | 10 - .../api/_pages/SessionServerRoute.php | 26 - tests/codeception/api/codeception.yml | 27 - tests/codeception/api/functional.suite.yml | 22 - tests/codeception/api/unit.suite.yml | 12 - tests/codeception/bin/_bootstrap.php | 9 - tests/codeception/bin/yii | 12 - tests/codeception/common/.gitignore | 2 - tests/codeception/common/_bootstrap.php | 13 - .../common/_support/UnitTester.php | 26 - tests/codeception/common/codeception.yml | 22 - tests/codeception/common/unit.suite.yml | 12 - .../codeception/common/unit/fixtures/.gitkeep | 0 tests/codeception/config/api/functional.php | 10 - tests/codeception/config/api/unit.php | 7 - tests/codeception/config/common/unit.php | 10 - tests/codeception/config/config.php | 30 - tests/codeception/config/console/unit.php | 6 - tests/codeception/config/functional.php | 11 - tests/codeception/config/unit.php | 4 - tests/codeception/console/.gitignore | 2 - tests/codeception/console/_bootstrap.php | 14 - tests/codeception/console/_output/.gitignore | 2 - .../console/_support/UnitTester.php | 26 - tests/codeception/console/codeception.yml | 24 - tests/codeception/console/unit.suite.yml | 12 - tests/codeception/console/unit/_bootstrap.php | 2 - tests/docker-compose.yml | 43 -- 248 files changed, 1503 insertions(+), 1339 deletions(-) create mode 100644 api/codeception.dist.yml rename tests/codeception/config/api/config.php => api/config/config-test.php (59%) delete mode 100644 api/config/params.php create mode 100644 api/tests/.gitignore create mode 100644 api/tests/_bootstrap.php rename {tests/codeception => api/tests}/_output/.gitignore (100%) rename {tests/codeception/api => api/tests}/_pages/AccountsRoute.php (60%) rename {tests/codeception/api => api/tests}/_pages/AuthenticationRoute.php (75%) create mode 100644 api/tests/_pages/AuthserverRoute.php rename {tests/codeception/api => api/tests}/_pages/BasePage.php (76%) create mode 100644 api/tests/_pages/IdentityInfoRoute.php create mode 100644 api/tests/_pages/InternalRoute.php rename {tests/codeception/api => api/tests}/_pages/MojangApiRoute.php (52%) create mode 100644 api/tests/_pages/OauthRoute.php create mode 100644 api/tests/_pages/OptionsRoute.php create mode 100644 api/tests/_pages/SessionServerRoute.php rename {tests/codeception/api => api/tests}/_pages/SignupRoute.php (50%) rename {tests/codeception/api => api/tests}/_support/FunctionalTester.php (65%) create mode 100644 api/tests/_support/UnitTester.php create mode 100644 api/tests/config/functional.php create mode 100644 api/tests/config/unit.php create mode 100644 api/tests/functional.suite.dist.yml rename {tests/codeception/api => api/tests}/functional/EmailConfirmationCest.php (95%) rename {tests/codeception/api => api/tests}/functional/FeedbackCest.php (83%) rename {tests/codeception/api => api/tests}/functional/ForgotPasswordCest.php (94%) rename {tests/codeception/api => api/tests}/functional/LoginCest.php (98%) rename {tests/codeception/api => api/tests}/functional/LogoutCest.php (73%) rename {tests/codeception/api => api/tests}/functional/OptionsCest.php (80%) rename {tests/codeception/api => api/tests}/functional/RecoverPasswordCest.php (84%) rename {tests/codeception/api => api/tests}/functional/RefreshTokenCest.php (86%) rename {tests/codeception/api => api/tests}/functional/RegisterCest.php (98%) rename {tests/codeception/api => api/tests}/functional/RepeatAccountActivationCest.php (94%) rename {tests/codeception/api => api/tests}/functional/_bootstrap.php (100%) rename {tests/codeception/api => api/tests}/functional/_steps/AuthserverSteps.php (74%) rename {tests/codeception/api => api/tests}/functional/_steps/OauthSteps.php (94%) rename {tests/codeception/api => api/tests}/functional/_steps/SessionServerSteps.php (93%) rename {tests/codeception/api => api/tests}/functional/accounts/AcceptRulesCest.php (77%) rename {tests/codeception/api => api/tests}/functional/accounts/BanCest.php (84%) rename {tests/codeception/api => api/tests}/functional/accounts/ChangeEmailConfirmNewEmailCest.php (82%) rename {tests/codeception/api => api/tests}/functional/accounts/ChangeEmailInitializeCest.php (89%) rename {tests/codeception/api => api/tests}/functional/accounts/ChangeEmailSubmitNewEmailCest.php (79%) rename {tests/codeception/api => api/tests}/functional/accounts/ChangeLangCest.php (79%) rename {tests/codeception/api => api/tests}/functional/accounts/ChangePasswordCest.php (85%) rename {tests/codeception/api => api/tests}/functional/accounts/ChangeUsernameCest.php (90%) rename {tests/codeception/api => api/tests}/functional/accounts/DisableTwoFactorAuthCest.php (92%) rename {tests/codeception/api => api/tests}/functional/accounts/EnableTwoFactorAuthCest.php (93%) rename {tests/codeception/api => api/tests}/functional/accounts/GetCest.php (96%) rename {tests/codeception/api => api/tests}/functional/accounts/PardonCest.php (84%) rename {tests/codeception/api => api/tests}/functional/accounts/TwoFactorAuthCredentialsCest.php (81%) rename {tests/codeception/api => api/tests}/functional/authserver/AuthorizationCest.php (97%) rename {tests/codeception/api => api/tests}/functional/authserver/InvalidateCest.php (89%) rename {tests/codeception/api => api/tests}/functional/authserver/RefreshCest.php (93%) rename {tests/codeception/api => api/tests}/functional/authserver/SignoutCest.php (92%) rename {tests/codeception/api => api/tests}/functional/authserver/ValidateCest.php (92%) rename {tests/codeception/api => api/tests}/functional/internal/InfoCest.php (91%) rename {tests/codeception/api => api/tests}/functional/mojang/UsernameToUuidCest.php (93%) rename {tests/codeception/api => api/tests}/functional/mojang/UsernamesToUuidsCest.php (96%) rename {tests/codeception/api => api/tests}/functional/mojang/UuidToUsernamesHistoryCest.php (93%) rename {tests/codeception/api => api/tests}/functional/oauth/AccessTokenCest.php (94%) rename {tests/codeception/api => api/tests}/functional/oauth/AuthCodeCest.php (98%) rename {tests/codeception/api => api/tests}/functional/oauth/ClientCredentialsCest.php (95%) rename {tests/codeception/api => api/tests}/functional/oauth/CreateClientCest.php (96%) rename {tests/codeception/api => api/tests}/functional/oauth/DeleteClientCest.php (80%) rename {tests/codeception/api => api/tests}/functional/oauth/GetClientsCest.php (95%) rename {tests/codeception/api/functional => api/tests/functional/oauth}/IdentityInfoCest.php (70%) rename {tests/codeception/api => api/tests}/functional/oauth/RefreshTokenCest.php (95%) rename {tests/codeception/api => api/tests}/functional/oauth/ResetClientCest.php (94%) rename {tests/codeception/api => api/tests}/functional/oauth/UpdateClientCest.php (94%) rename {tests/codeception/api => api/tests}/functional/sessionserver/HasJoinedCest.php (87%) rename {tests/codeception/api => api/tests}/functional/sessionserver/HasJoinedLegacyCest.php (85%) rename {tests/codeception/api => api/tests}/functional/sessionserver/JoinCest.php (95%) rename {tests/codeception/api => api/tests}/functional/sessionserver/JoinLegacyCest.php (93%) rename {tests/codeception/api => api/tests}/functional/sessionserver/ProfileCest.php (89%) create mode 100644 api/tests/unit.suite.dist.yml rename {tests/codeception/api => api/tests}/unit/TestCase.php (86%) rename {tests/codeception/api => api/tests}/unit/_bootstrap.php (100%) rename {tests/codeception/api => api/tests}/unit/components/ReCaptcha/ValidatorTest.php (98%) rename {tests/codeception/api => api/tests}/unit/components/User/ComponentTest.php (97%) rename {tests/codeception/api => api/tests}/unit/components/User/JwtAuthenticationResultTest.php (95%) rename {tests/codeception/api => api/tests}/unit/filters/NginxCacheTest.php (95%) rename {tests/codeception/api => api/tests}/unit/models/FeedbackFormTest.php (97%) rename {tests/codeception/api => api/tests}/unit/models/JwtIdentityTest.php (93%) rename {tests/codeception/api => api/tests}/unit/models/authentication/ConfirmEmailFormTest.php (89%) rename {tests/codeception/api => api/tests}/unit/models/authentication/ForgotPasswordFormTest.php (97%) rename {tests/codeception/api => api/tests}/unit/models/authentication/LoginFormTest.php (97%) rename {tests/codeception/api => api/tests}/unit/models/authentication/LogoutFormTest.php (95%) rename {tests/codeception/api => api/tests}/unit/models/authentication/RecoverPasswordFormTest.php (88%) rename {tests/codeception/api => api/tests}/unit/models/authentication/RefreshTokenFormTest.php (94%) rename {tests/codeception/api => api/tests}/unit/models/authentication/RegistrationFormTest.php (91%) rename {tests/codeception/api => api/tests}/unit/models/authentication/RepeatAccountActivationFormTest.php (95%) rename {tests/codeception/api => api/tests}/unit/models/base/ApiFormTest.php (85%) rename {tests/codeception/api => api/tests}/unit/models/profile/TwoFactorAuthFormTest.php (100%) rename {tests/codeception/api => api/tests}/unit/modules/accounts/models/AcceptRulesFormTest.php (86%) rename {tests/codeception/api => api/tests}/unit/modules/accounts/models/ChangeEmailFormTest.php (85%) rename {tests/codeception/api => api/tests}/unit/modules/accounts/models/ChangeLanguageFormTest.php (84%) rename {tests/codeception/api => api/tests}/unit/modules/accounts/models/ChangePasswordFormTest.php (98%) rename {tests/codeception/api => api/tests}/unit/modules/accounts/models/ChangeUsernameFormTest.php (92%) rename {tests/codeception/api => api/tests}/unit/modules/accounts/models/DisableTwoFactorAuthFormTest.php (93%) rename {tests/codeception/api => api/tests}/unit/modules/accounts/models/EnableTwoFactorAuthFormTest.php (94%) rename {tests/codeception/api => api/tests}/unit/modules/accounts/models/SendEmailVerificationFormTest.php (89%) rename {tests/codeception/api => api/tests}/unit/modules/accounts/models/SendNewEmailVerificationFormTest.php (90%) rename {tests/codeception/api => api/tests}/unit/modules/accounts/models/TwoFactorAuthInfoTest.php (93%) rename {tests/codeception/api => api/tests}/unit/modules/authserver/models/AuthenticationFormTest.php (96%) rename {tests/codeception/api => api/tests}/unit/modules/authserver/validators/RequiredValidatorTest.php (87%) rename {tests/codeception/api => api/tests}/unit/modules/internal/models/BanFormTest.php (93%) rename {tests/codeception/api => api/tests}/unit/modules/internal/models/PardonFormTest.php (92%) rename {tests/codeception/api => api/tests}/unit/modules/oauth/models/ApplicationTypeTest.php (89%) rename {tests/codeception/api => api/tests}/unit/modules/oauth/models/BaseOauthClientTypeTest.php (86%) rename {tests/codeception/api => api/tests}/unit/modules/oauth/models/MinecraftServerTypeTest.php (86%) rename {tests/codeception/api => api/tests}/unit/modules/oauth/models/OauthClientFormFactoryTest.php (95%) rename {tests/codeception/api => api/tests}/unit/modules/oauth/models/OauthClientFormTest.php (98%) rename {tests/codeception/api => api/tests}/unit/modules/session/filters/RateLimiterTest.php (64%) rename {tests/codeception/api => api/tests}/unit/request/RequestParserTest.php (87%) rename {tests/codeception/api => api/tests}/unit/traits/AccountFinderTest.php (91%) rename {tests/codeception/api => api/tests}/unit/validators/EmailActivationKeyValidatorTest.php (95%) rename {tests/codeception/api => api/tests}/unit/validators/PasswordRequiredValidatorTest.php (93%) rename {tests/codeception/api => api/tests}/unit/validators/TotpValidatorTest.php (92%) create mode 100644 codeception.dist.yml create mode 100644 common/codeception.dist.yml create mode 100644 common/config/config-test.php delete mode 100644 common/config/params.php create mode 100644 common/tests/.gitignore create mode 100644 common/tests/_bootstrap.php rename {tests/codeception/api => common/tests}/_output/.gitignore (100%) create mode 100644 common/tests/_support/ApplicationRedisBridge.php rename {tests/codeception/common => common/tests}/_support/FixtureHelper.php (77%) rename {tests/codeception/common => common/tests}/_support/Mockery.php (93%) rename {tests/codeception/common => common/tests}/_support/ProtectedCaller.php (87%) rename {tests/codeception/api => common/tests}/_support/UnitTester.php (94%) rename {tests/codeception/common => common/tests}/_support/queue/CodeceptionQueueHelper.php (96%) rename {tests/codeception/common => common/tests}/_support/queue/Queue.php (93%) create mode 100644 common/tests/config/unit.php rename {tests/codeception/common => common/tests}/fixtures/AccountFixture.php (55%) rename {tests/codeception/common => common/tests}/fixtures/AccountSessionFixture.php (64%) rename {tests/codeception/common => common/tests}/fixtures/EmailActivationFixture.php (64%) rename {tests/codeception/common => common/tests}/fixtures/MinecraftAccessKeyFixture.php (64%) rename {tests/codeception/common => common/tests}/fixtures/MojangUsernameFixture.php (57%) rename {tests/codeception/common => common/tests}/fixtures/OauthClientFixture.php (63%) rename {tests/codeception/common => common/tests}/fixtures/OauthSessionFixture.php (67%) rename {tests/codeception/common => common/tests}/fixtures/UsernameHistoryFixture.php (57%) rename {tests/codeception/common => common/tests}/fixtures/WebHooksEventsFixture.php (66%) rename {tests/codeception/common => common/tests}/fixtures/WebHooksFixture.php (59%) rename {tests/codeception/common => common/tests}/fixtures/data/account-sessions.php (100%) rename {tests/codeception/common => common/tests}/fixtures/data/accounts.php (100%) rename {tests/codeception/common => common/tests}/fixtures/data/email-activations.php (100%) rename {tests/codeception/common => common/tests}/fixtures/data/minecraft-access-keys.php (100%) rename {tests/codeception/common => common/tests}/fixtures/data/mojang-usernames.php (100%) rename {tests/codeception/common => common/tests}/fixtures/data/oauth-clients.php (100%) rename {tests/codeception/common => common/tests}/fixtures/data/oauth-sessions.php (100%) rename {tests/codeception/common => common/tests}/fixtures/data/usernames-history.php (100%) rename {tests/codeception/common => common/tests}/fixtures/data/webhooks-events.php (100%) rename {tests/codeception/common => common/tests}/fixtures/data/webhooks.php (100%) rename {tests/codeception/common => common/tests}/helpers/Mock.php (92%) rename {tests/codeception/common => common/tests}/templates/fixtures/account.php (100%) create mode 100644 common/tests/unit.suite.dist.yml rename {tests/codeception/common => common/tests}/unit/TestCase.php (85%) rename {tests/codeception/common => common/tests}/unit/_bootstrap.php (100%) rename {tests/codeception/common => common/tests}/unit/behaviors/DataBehaviorTest.php (94%) rename {tests/codeception/common => common/tests}/unit/behaviors/EmailActivationExpirationBehaviorTest.php (96%) rename {tests/codeception/common => common/tests}/unit/behaviors/PrimaryKeyValueBehaviorTest.php (96%) rename {tests/codeception/common => common/tests}/unit/components/Mojang/ApiTest.php (94%) rename {tests/codeception/common => common/tests}/unit/db/mysql/QueryBuilderTest.php (80%) rename {tests/codeception/common => common/tests}/unit/emails/EmailHelperTest.php (71%) rename {tests/codeception/common => common/tests}/unit/emails/TemplateTest.php (92%) rename {tests/codeception/common => common/tests}/unit/emails/TemplateWithRendererTest.php (93%) rename {tests/codeception/common => common/tests}/unit/helpers/StringHelperTest.php (96%) rename {tests/codeception/common => common/tests}/unit/models/AccountSessionTest.php (90%) rename {tests/codeception/common => common/tests}/unit/models/AccountTest.php (97%) rename {tests/codeception/common => common/tests}/unit/models/EmailActivationTest.php (87%) rename {tests/codeception/common => common/tests}/unit/models/OauthClientQueryTest.php (89%) rename {tests/codeception/common => common/tests}/unit/rbac/rules/AccountOwnerTest.php (96%) rename {tests/codeception/common => common/tests}/unit/rbac/rules/OauthClientOwnerTest.php (92%) rename {tests/codeception/common => common/tests}/unit/tasks/ClearAccountSessionsTest.php (90%) rename {tests/codeception/common => common/tests}/unit/tasks/ClearOauthSessionsTest.php (93%) rename {tests/codeception/common => common/tests}/unit/tasks/CreateWebHooksDeliveriesTest.php (96%) rename {tests/codeception/common => common/tests}/unit/tasks/DeliveryWebHookTest.php (98%) rename {tests/codeception/common => common/tests}/unit/tasks/PullMojangUsernameTest.php (97%) rename {tests/codeception/common => common/tests}/unit/tasks/SendCurrentEmailConfirmationTest.php (95%) rename {tests/codeception/common => common/tests}/unit/tasks/SendNewEmailConfirmationTest.php (95%) rename {tests/codeception/common => common/tests}/unit/tasks/SendPasswordRecoveryEmailTest.php (95%) rename {tests/codeception/common => common/tests}/unit/tasks/SendRegistrationEmailTest.php (95%) rename {tests/codeception/common => common/tests}/unit/validators/EmailValidatorTest.php (96%) rename {tests/codeception/common => common/tests}/unit/validators/LanguageValidatorTest.php (92%) rename {tests/codeception/common => common/tests}/unit/validators/MinecraftServerAddressValidatorTest.php (90%) rename {tests/codeception/common => common/tests}/unit/validators/UsernameValidatorTest.php (96%) rename {tests/codeception/common => common/tests}/unit/validators/UuidValidatorTest.php (96%) create mode 100644 console/codeception.dist.yml delete mode 100644 console/config/params.php create mode 100644 console/tests/.gitignore create mode 100644 console/tests/_bootstrap.php rename {tests/codeception/common => console/tests}/_output/.gitignore (100%) create mode 100644 console/tests/_support/UnitTester.php create mode 100644 console/tests/config/unit.php create mode 100644 console/tests/unit.suite.dist.yml rename {tests/codeception/console => console/tests}/unit/TestCase.php (68%) create mode 100644 console/tests/unit/_bootstrap.php rename {tests/codeception/console => console/tests}/unit/controllers/CleanupControllerTest.php (95%) delete mode 100644 tests/.gitignore delete mode 100644 tests/codeception.yml delete mode 100644 tests/codeception/api/.gitignore delete mode 100644 tests/codeception/api/_bootstrap.php delete mode 100644 tests/codeception/api/_pages/AuthserverRoute.php delete mode 100644 tests/codeception/api/_pages/IdentityInfoRoute.php delete mode 100644 tests/codeception/api/_pages/InternalRoute.php delete mode 100644 tests/codeception/api/_pages/OauthRoute.php delete mode 100644 tests/codeception/api/_pages/OptionsRoute.php delete mode 100644 tests/codeception/api/_pages/SessionServerRoute.php delete mode 100644 tests/codeception/api/codeception.yml delete mode 100644 tests/codeception/api/functional.suite.yml delete mode 100644 tests/codeception/api/unit.suite.yml delete mode 100644 tests/codeception/bin/_bootstrap.php delete mode 100644 tests/codeception/bin/yii delete mode 100644 tests/codeception/common/.gitignore delete mode 100644 tests/codeception/common/_bootstrap.php delete mode 100644 tests/codeception/common/_support/UnitTester.php delete mode 100644 tests/codeception/common/codeception.yml delete mode 100644 tests/codeception/common/unit.suite.yml delete mode 100644 tests/codeception/common/unit/fixtures/.gitkeep delete mode 100644 tests/codeception/config/api/functional.php delete mode 100644 tests/codeception/config/api/unit.php delete mode 100644 tests/codeception/config/common/unit.php delete mode 100644 tests/codeception/config/config.php delete mode 100644 tests/codeception/config/console/unit.php delete mode 100644 tests/codeception/config/functional.php delete mode 100644 tests/codeception/config/unit.php delete mode 100644 tests/codeception/console/.gitignore delete mode 100644 tests/codeception/console/_bootstrap.php delete mode 100644 tests/codeception/console/_output/.gitignore delete mode 100644 tests/codeception/console/_support/UnitTester.php delete mode 100644 tests/codeception/console/codeception.yml delete mode 100644 tests/codeception/console/unit.suite.yml delete mode 100644 tests/codeception/console/unit/_bootstrap.php delete mode 100644 tests/docker-compose.yml diff --git a/.gitignore b/.gitignore index f18c018..e17f58f 100644 --- a/.gitignore +++ b/.gitignore @@ -23,3 +23,7 @@ npm-debug* # PHP-CS-Fixer .php_cs .php_cs.cache + +# Codeception +codeception.yml +*/codeception.yml diff --git a/api/codeception.dist.yml b/api/codeception.dist.yml new file mode 100644 index 0000000..527e806 --- /dev/null +++ b/api/codeception.dist.yml @@ -0,0 +1,26 @@ +namespace: api\tests +actor_suffix: Tester +paths: + tests: tests + log: tests/_output + data: tests/_data + helpers: tests/_support +settings: + bootstrap: _bootstrap.php + colors: true + memory_limit: 1024M +coverage: + enabled: true + remote: true + whitelist: + include: + - ./* + exclude: + - aop/* + - config/* + - runtime/* + - tests/* + - web/* + - codeception.dist.yml + - codeception.yml + c3url: 'http://localhost/api/web/index.php' diff --git a/tests/codeception/config/api/config.php b/api/config/config-test.php similarity index 59% rename from tests/codeception/config/api/config.php rename to api/config/config-test.php index c6ea4c5..7e5ff0c 100644 --- a/tests/codeception/config/api/config.php +++ b/api/config/config-test.php @@ -1,7 +1,4 @@ [ 'user' => [ @@ -12,18 +9,13 @@ return [ 'secret' => 'private-key', ], ], - 'modules' => [ - 'authserver' => [ - 'host' => 'localhost', - ], - ], 'params' => [ - 'authserverHost' => 'authserver.ely.by', + 'authserverHost' => 'localhost', ], 'container' => [ 'definitions' => [ - Validator::class => function() { - return new class(new Client()) extends Validator { + api\components\ReCaptcha\Validator::class => function() { + return new class(new GuzzleHttp\Client()) extends api\components\ReCaptcha\Validator { protected function validateValue($value) { return null; } diff --git a/api/config/config.php b/api/config/config.php index ffe0ee2..46a30f9 100644 --- a/api/config/config.php +++ b/api/config/config.php @@ -1,15 +1,12 @@ '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, diff --git a/api/config/params.php b/api/config/params.php deleted file mode 100644 index 5412ed8..0000000 --- a/api/config/params.php +++ /dev/null @@ -1,4 +0,0 @@ - getenv('AUTHSERVER_HOST'), -]; diff --git a/api/config/routes.php b/api/config/routes.php index 9a385ef..f61cab1 100644 --- a/api/config/routes.php +++ b/api/config/routes.php @@ -1,7 +1,4 @@ ' => 'oauth/authorization/', @@ -46,8 +43,4 @@ return [ '/mojang/profiles/' => 'mojang/api/uuid-by-username', '/mojang/profiles//names' => 'mojang/api/usernames-by-uuid', 'POST /mojang/profiles' => 'mojang/api/uuids-by-usernames', - - "//{$params['authserverHost']}/mojang/api/users/profiles/minecraft/" => 'mojang/api/uuid-by-username', - "//{$params['authserverHost']}/mojang/api/user/profiles//names" => 'mojang/api/usernames-by-uuid', - "POST //{$params['authserverHost']}/mojang/api/profiles/minecraft" => 'mojang/api/uuids-by-usernames', ]; diff --git a/api/modules/authserver/Module.php b/api/modules/authserver/Module.php index 793c658..b2c1b22 100644 --- a/api/modules/authserver/Module.php +++ b/api/modules/authserver/Module.php @@ -1,9 +1,10 @@ host === null) { - throw new InvalidConfigException('base domain must be specified'); - } - } - public function beforeAction($action) { if (!parent::beforeAction($action)) { return false; @@ -35,11 +24,12 @@ class Module extends \yii\base\Module implements BootstrapInterface { } /** - * @param \yii\base\Application $app the application currently running + * @param \yii\base\Application $app */ public function bootstrap($app) { + $legacyHost = $app->params['authserverHost']; $app->getUrlManager()->addRules([ - "//$this->host/$this->id/auth/" => "$this->id/authentication/", + "//{$legacyHost}/authserver/auth/" => "{$this->id}/authentication/", ], false); } @@ -59,7 +49,7 @@ class Module extends \yii\base\Module implements BootstrapInterface { * @throws NotFoundHttpException */ protected function checkHost() { - if (parse_url(Yii::$app->request->getHostInfo(), PHP_URL_HOST) !== $this->host) { + if (parse_url(Yii::$app->request->getHostInfo(), PHP_URL_HOST) !== Yii::$app->params['authserverHost']) { throw new NotFoundHttpException(); } } diff --git a/api/modules/mojang/Module.php b/api/modules/mojang/Module.php index 9306443..5c41899 100644 --- a/api/modules/mojang/Module.php +++ b/api/modules/mojang/Module.php @@ -1,10 +1,26 @@ params['authserverHost']; + $app->getUrlManager()->addRules([ + "//{$legacyHost}/mojang/api/users/profiles/minecraft/" => "{$this->id}/api/uuid-by-username", + "//{$legacyHost}/mojang/api/user/profiles//names" => "{$this->id}/api/usernames-by-uuid", + "POST //{$legacyHost}/mojang/api/profiles/minecraft" => "{$this->id}/api/uuids-by-usernames", + ]); + } + } diff --git a/api/modules/oauth/controllers/AuthorizationController.php b/api/modules/oauth/controllers/AuthorizationController.php index d0ad35c..03d073f 100644 --- a/api/modules/oauth/controllers/AuthorizationController.php +++ b/api/modules/oauth/controllers/AuthorizationController.php @@ -55,7 +55,10 @@ class AuthorizationController extends Controller { } private function createOauthProcess(): OauthProcess { - return new OauthProcess(Yii::$app->oauth->authServer); + $server = Yii::$app->oauth->authServer; + $server->setRequest(null); // Enforce request recreation (test environment bug) + + return new OauthProcess($server); } } diff --git a/api/tests/.gitignore b/api/tests/.gitignore new file mode 100644 index 0000000..3adb08b --- /dev/null +++ b/api/tests/.gitignore @@ -0,0 +1,3 @@ +functional.suite.yml +unit.suite.yml +_support/_generated diff --git a/api/tests/_bootstrap.php b/api/tests/_bootstrap.php new file mode 100644 index 0000000..156889d --- /dev/null +++ b/api/tests/_bootstrap.php @@ -0,0 +1,10 @@ +getActor()->sendGET("/v1/accounts/{$accountId}"); + $this->getActor()->sendGET("/api/v1/accounts/{$accountId}"); } public function changePassword(int $accountId, $currentPassword = null, $newPassword = null, $newRePassword = null) { - $this->getActor()->sendPOST("/v1/accounts/{$accountId}/password", [ + $this->getActor()->sendPOST("/api/v1/accounts/{$accountId}/password", [ 'password' => $currentPassword, 'newPassword' => $newPassword, 'newRePassword' => $newRePassword, @@ -16,65 +16,65 @@ class AccountsRoute extends BasePage { } public function changeUsername(int $accountId, $currentPassword = null, $newUsername = null) { - $this->getActor()->sendPOST("/v1/accounts/{$accountId}/username", [ + $this->getActor()->sendPOST("/api/v1/accounts/{$accountId}/username", [ 'password' => $currentPassword, 'username' => $newUsername, ]); } public function changeEmailInitialize(int $accountId, $password = '') { - $this->getActor()->sendPOST("/v1/accounts/{$accountId}/email-verification", [ + $this->getActor()->sendPOST("/api/v1/accounts/{$accountId}/email-verification", [ 'password' => $password, ]); } public function changeEmailSubmitNewEmail(int $accountId, $key = null, $email = null) { - $this->getActor()->sendPOST("/v1/accounts/{$accountId}/new-email-verification", [ + $this->getActor()->sendPOST("/api/v1/accounts/{$accountId}/new-email-verification", [ 'key' => $key, 'email' => $email, ]); } public function changeEmail(int $accountId, $key = null) { - $this->getActor()->sendPOST("/v1/accounts/{$accountId}/email", [ + $this->getActor()->sendPOST("/api/v1/accounts/{$accountId}/email", [ 'key' => $key, ]); } public function changeLanguage(int $accountId, $lang = null) { - $this->getActor()->sendPOST("/v1/accounts/{$accountId}/language", [ + $this->getActor()->sendPOST("/api/v1/accounts/{$accountId}/language", [ 'lang' => $lang, ]); } public function acceptRules(int $accountId) { - $this->getActor()->sendPOST("/v1/accounts/{$accountId}/rules"); + $this->getActor()->sendPOST("/api/v1/accounts/{$accountId}/rules"); } public function getTwoFactorAuthCredentials(int $accountId) { - $this->getActor()->sendGET("/v1/accounts/{$accountId}/two-factor-auth"); + $this->getActor()->sendGET("/api/v1/accounts/{$accountId}/two-factor-auth"); } public function enableTwoFactorAuth(int $accountId, $totp = null, $password = null) { - $this->getActor()->sendPOST("/v1/accounts/{$accountId}/two-factor-auth", [ + $this->getActor()->sendPOST("/api/v1/accounts/{$accountId}/two-factor-auth", [ 'totp' => $totp, 'password' => $password, ]); } public function disableTwoFactorAuth(int $accountId, $totp = null, $password = null) { - $this->getActor()->sendDELETE("/v1/accounts/{$accountId}/two-factor-auth", [ + $this->getActor()->sendDELETE("/api/v1/accounts/{$accountId}/two-factor-auth", [ 'totp' => $totp, 'password' => $password, ]); } public function ban(int $accountId) { - $this->getActor()->sendPOST("/v1/accounts/{$accountId}/ban"); + $this->getActor()->sendPOST("/api/v1/accounts/{$accountId}/ban"); } public function pardon(int $accountId) { - $this->getActor()->sendDELETE("/v1/accounts/{$accountId}/ban"); + $this->getActor()->sendDELETE("/api/v1/accounts/{$accountId}/ban"); } } diff --git a/tests/codeception/api/_pages/AuthenticationRoute.php b/api/tests/_pages/AuthenticationRoute.php similarity index 75% rename from tests/codeception/api/_pages/AuthenticationRoute.php rename to api/tests/_pages/AuthenticationRoute.php index 6ce52f1..d926d0b 100644 --- a/tests/codeception/api/_pages/AuthenticationRoute.php +++ b/api/tests/_pages/AuthenticationRoute.php @@ -1,5 +1,5 @@ getActor()->sendPOST('/authentication/login', $params); + $this->getActor()->sendPOST('/api/authentication/login', $params); } public function logout() { - $this->getActor()->sendPOST('/authentication/logout'); + $this->getActor()->sendPOST('/api/authentication/logout'); } public function forgotPassword($login = null, $token = null) { - $this->getActor()->sendPOST('/authentication/forgot-password', [ + $this->getActor()->sendPOST('/api/authentication/forgot-password', [ 'login' => $login, 'totp' => $token, ]); } public function recoverPassword($key = null, $newPassword = null, $newRePassword = null) { - $this->getActor()->sendPOST('/authentication/recover-password', [ + $this->getActor()->sendPOST('/api/authentication/recover-password', [ 'key' => $key, 'newPassword' => $newPassword, 'newRePassword' => $newRePassword, @@ -44,7 +44,7 @@ class AuthenticationRoute extends BasePage { } public function refreshToken($refreshToken = null) { - $this->getActor()->sendPOST('/authentication/refresh-token', [ + $this->getActor()->sendPOST('/api/authentication/refresh-token', [ 'refresh_token' => $refreshToken, ]); } diff --git a/api/tests/_pages/AuthserverRoute.php b/api/tests/_pages/AuthserverRoute.php new file mode 100644 index 0000000..90649c1 --- /dev/null +++ b/api/tests/_pages/AuthserverRoute.php @@ -0,0 +1,26 @@ +getActor()->sendPOST('/api/authserver/authentication/authenticate', $params); + } + + public function refresh($params) { + $this->getActor()->sendPOST('/api/authserver/authentication/refresh', $params); + } + + public function validate($params) { + $this->getActor()->sendPOST('/api/authserver/authentication/validate', $params); + } + + public function invalidate($params) { + $this->getActor()->sendPOST('/api/authserver/authentication/invalidate', $params); + } + + public function signout($params) { + $this->getActor()->sendPOST('/api/authserver/authentication/signout', $params); + } + +} diff --git a/tests/codeception/api/_pages/BasePage.php b/api/tests/_pages/BasePage.php similarity index 76% rename from tests/codeception/api/_pages/BasePage.php rename to api/tests/_pages/BasePage.php index 8bf9dad..17e2130 100644 --- a/tests/codeception/api/_pages/BasePage.php +++ b/api/tests/_pages/BasePage.php @@ -1,7 +1,7 @@ getActor()->sendGET('/api/account/v1/info'); + } + +} diff --git a/api/tests/_pages/InternalRoute.php b/api/tests/_pages/InternalRoute.php new file mode 100644 index 0000000..c383a96 --- /dev/null +++ b/api/tests/_pages/InternalRoute.php @@ -0,0 +1,10 @@ +getActor()->sendGET('/api/internal/accounts/info', [$param => $value]); + } + +} diff --git a/tests/codeception/api/_pages/MojangApiRoute.php b/api/tests/_pages/MojangApiRoute.php similarity index 52% rename from tests/codeception/api/_pages/MojangApiRoute.php rename to api/tests/_pages/MojangApiRoute.php index 7a2a25c..3fdebb1 100644 --- a/tests/codeception/api/_pages/MojangApiRoute.php +++ b/api/tests/_pages/MojangApiRoute.php @@ -1,19 +1,19 @@ $at]; - $this->getActor()->sendGET("/mojang/profiles/{$username}", $params); + $this->getActor()->sendGET("/api/mojang/profiles/{$username}", $params); } public function usernamesByUuid($uuid) { - $this->getActor()->sendGET("/mojang/profiles/{$uuid}/names"); + $this->getActor()->sendGET("/api/mojang/profiles/{$uuid}/names"); } public function uuidsByUsernames($uuids) { - $this->getActor()->sendPOST('/mojang/profiles', $uuids); + $this->getActor()->sendPOST('/api/mojang/profiles', $uuids); } } diff --git a/api/tests/_pages/OauthRoute.php b/api/tests/_pages/OauthRoute.php new file mode 100644 index 0000000..a4473ce --- /dev/null +++ b/api/tests/_pages/OauthRoute.php @@ -0,0 +1,42 @@ +getActor()->sendGET('/api/oauth2/v1/validate', $queryParams); + } + + public function complete(array $queryParams = [], array $postParams = []): void { + $this->getActor()->sendPOST('/api/oauth2/v1/complete?' . http_build_query($queryParams), $postParams); + } + + public function issueToken(array $postParams = []): void { + $this->getActor()->sendPOST('/api/oauth2/v1/token', $postParams); + } + + public function createClient(string $type, array $postParams): void { + $this->getActor()->sendPOST('/api/v1/oauth2/' . $type, $postParams); + } + + public function updateClient(string $clientId, array $params): void { + $this->getActor()->sendPUT('/api/v1/oauth2/' . $clientId, $params); + } + + public function deleteClient(string $clientId): void { + $this->getActor()->sendDELETE('/api/v1/oauth2/' . $clientId); + } + + public function resetClient(string $clientId, bool $regenerateSecret = false): void { + $this->getActor()->sendPOST("/api/v1/oauth2/$clientId/reset" . ($regenerateSecret ? '?regenerateSecret' : '')); + } + + public function getClient(string $clientId): void { + $this->getActor()->sendGET("/api/v1/oauth2/$clientId"); + } + + public function getPerAccount(int $accountId): void { + $this->getActor()->sendGET("/api/v1/accounts/$accountId/oauth2/clients"); + } + +} diff --git a/api/tests/_pages/OptionsRoute.php b/api/tests/_pages/OptionsRoute.php new file mode 100644 index 0000000..2f4a2d3 --- /dev/null +++ b/api/tests/_pages/OptionsRoute.php @@ -0,0 +1,10 @@ +getActor()->sendGET('/api/options'); + } + +} diff --git a/api/tests/_pages/SessionServerRoute.php b/api/tests/_pages/SessionServerRoute.php new file mode 100644 index 0000000..677f4d5 --- /dev/null +++ b/api/tests/_pages/SessionServerRoute.php @@ -0,0 +1,26 @@ +getActor()->sendPOST('/api/minecraft/session/join', $params); + } + + public function joinLegacy(array $params) { + $this->getActor()->sendGET('/api/minecraft/session/legacy/join', $params); + } + + public function hasJoined(array $params) { + $this->getActor()->sendGET('/api/minecraft/session/hasJoined', $params); + } + + public function hasJoinedLegacy(array $params) { + $this->getActor()->sendGET('/api/minecraft/session/legacy/hasJoined', $params); + } + + public function profile($profileUuid) { + $this->getActor()->sendGET("/api/minecraft/session/profile/{$profileUuid}"); + } + +} diff --git a/tests/codeception/api/_pages/SignupRoute.php b/api/tests/_pages/SignupRoute.php similarity index 50% rename from tests/codeception/api/_pages/SignupRoute.php rename to api/tests/_pages/SignupRoute.php index 4aba204..6ab219c 100644 --- a/tests/codeception/api/_pages/SignupRoute.php +++ b/api/tests/_pages/SignupRoute.php @@ -1,18 +1,18 @@ getActor()->sendPOST('/signup', $registrationData); + $this->getActor()->sendPOST('/api/signup', $registrationData); } public function sendRepeatMessage($email = '') { - $this->getActor()->sendPOST('/signup/repeat-message', ['email' => $email]); + $this->getActor()->sendPOST('/api/signup/repeat-message', ['email' => $email]); } public function confirm($key = '') { - $this->getActor()->sendPOST('/signup/confirm', [ + $this->getActor()->sendPOST('/api/signup/confirm', [ 'key' => $key, ]); } diff --git a/tests/codeception/api/_support/FunctionalTester.php b/api/tests/_support/FunctionalTester.php similarity index 65% rename from tests/codeception/api/_support/FunctionalTester.php rename to api/tests/_support/FunctionalTester.php index 3d2b489..45399cd 100644 --- a/tests/codeception/api/_support/FunctionalTester.php +++ b/api/tests/_support/FunctionalTester.php @@ -1,28 +1,16 @@ id; } - public function notLoggedIn() { + public function notLoggedIn(): void { $this->haveHttpHeader('Authorization', null); + Yii::$app->user->logout(); } - public function canSeeAuthCredentials($expectRefresh = false) { + public function canSeeAuthCredentials($expectRefresh = false): void { $this->canSeeResponseJsonMatchesJsonPath('$.access_token'); $this->canSeeResponseJsonMatchesJsonPath('$.expires_in'); if ($expectRefresh) { diff --git a/api/tests/_support/UnitTester.php b/api/tests/_support/UnitTester.php new file mode 100644 index 0000000..e7b2540 --- /dev/null +++ b/api/tests/_support/UnitTester.php @@ -0,0 +1,12 @@ +sendPOST('/feedback', [ + $I->sendPOST('/api/feedback', [ 'subject' => 'Test', 'email' => 'email@ely.by', 'type' => 0, @@ -21,7 +21,7 @@ class FeedbackCest { public function testFeedbackWithAuth(FunctionalTester $I) { $I->amAuthenticated(); - $I->sendPOST('/feedback', [ + $I->sendPOST('/api/feedback', [ 'subject' => 'Test', 'email' => 'email@ely.by', 'type' => 0, diff --git a/tests/codeception/api/functional/ForgotPasswordCest.php b/api/tests/functional/ForgotPasswordCest.php similarity index 94% rename from tests/codeception/api/functional/ForgotPasswordCest.php rename to api/tests/functional/ForgotPasswordCest.php index 72a7ef8..c9a88ff 100644 --- a/tests/codeception/api/functional/ForgotPasswordCest.php +++ b/api/tests/functional/ForgotPasswordCest.php @@ -1,8 +1,8 @@ toString(); $route->authenticate([ diff --git a/tests/codeception/api/functional/_steps/OauthSteps.php b/api/tests/functional/_steps/OauthSteps.php similarity index 94% rename from tests/codeception/api/functional/_steps/OauthSteps.php rename to api/tests/functional/_steps/OauthSteps.php index ff573b2..da3b9a6 100644 --- a/tests/codeception/api/functional/_steps/OauthSteps.php +++ b/api/tests/functional/_steps/OauthSteps.php @@ -1,9 +1,9 @@ 'Bearer', ]); $I->canSeeResponseJsonMatchesJsonPath('$.access_token'); + $I->cantSeeResponseJsonMatchesJsonPath('$.refresh_token'); $I->canSeeResponseJsonMatchesJsonPath('$.expires_in'); } diff --git a/tests/codeception/api/functional/oauth/AuthCodeCest.php b/api/tests/functional/oauth/AuthCodeCest.php similarity index 98% rename from tests/codeception/api/functional/oauth/AuthCodeCest.php rename to api/tests/functional/oauth/AuthCodeCest.php index daccabb..e0093c2 100644 --- a/tests/codeception/api/functional/oauth/AuthCodeCest.php +++ b/api/tests/functional/oauth/AuthCodeCest.php @@ -1,9 +1,9 @@ route = new IdentityInfoRoute($I); } + public function testGetErrorIfNoAccessToken(OauthSteps $I) { + $I->wantToTest('behavior when this endpoint called without Authorization header'); + $this->route->info(); + $I->canSeeResponseCodeIs(401); + $I->canSeeResponseIsJson(); + $I->canSeeResponseContainsJson([ + 'name' => 'Unauthorized', + 'status' => 401, + 'message' => 'Your request was made with invalid credentials.', + ]); + } + public function testGetErrorIfNotEnoughPerms(OauthSteps $I) { + $I->wantToTest('behavior when this endpoint called with token, that have not enough scopes'); $accessToken = $I->getAccessToken(); $I->amBearerAuthenticated($accessToken); $this->route->info(); @@ -25,6 +38,7 @@ class IdentityInfoCest { $I->canSeeResponseContainsJson([ 'name' => 'Forbidden', 'status' => 403, + 'message' => 'You are not allowed to perform this action.', ]); } diff --git a/tests/codeception/api/functional/oauth/RefreshTokenCest.php b/api/tests/functional/oauth/RefreshTokenCest.php similarity index 95% rename from tests/codeception/api/functional/oauth/RefreshTokenCest.php rename to api/tests/functional/oauth/RefreshTokenCest.php index e5185c2..16bd6c2 100644 --- a/tests/codeception/api/functional/oauth/RefreshTokenCest.php +++ b/api/tests/functional/oauth/RefreshTokenCest.php @@ -1,11 +1,11 @@ getMock(); $request - ->expects($this->any()) ->method('getUserIP') - ->will($this->returnValue($ip)); + ->willReturn($ip); Yii::$app->set('request', $request); diff --git a/tests/codeception/api/unit/models/authentication/RepeatAccountActivationFormTest.php b/api/tests/unit/models/authentication/RepeatAccountActivationFormTest.php similarity index 95% rename from tests/codeception/api/unit/models/authentication/RepeatAccountActivationFormTest.php rename to api/tests/unit/models/authentication/RepeatAccountActivationFormTest.php index 6dbebb1..5c1a254 100644 --- a/tests/codeception/api/unit/models/authentication/RepeatAccountActivationFormTest.php +++ b/api/tests/unit/models/authentication/RepeatAccountActivationFormTest.php @@ -1,5 +1,5 @@ getMockBuilder(Connection::class) ->setMethods(['executeCommand']) ->getMock(); @@ -22,23 +24,22 @@ class RateLimiterTest extends TestCase { Yii::$app->set('redis', $redis); - /** @var RateLimiter|\PHPUnit_Framework_MockObject_MockObject $filter */ + /** @var RateLimiter|\PHPUnit\Framework\MockObject\MockObject $filter */ $filter = $this->getMockBuilder(RateLimiter::class) ->setConstructorArgs([[ - 'authserverDomain' => Yii::$app->params['authserverHost'], + 'authserverDomain' => 'authserver.ely.by', ]]) ->setMethods(['getServer']) ->getMock(); - $filter->expects($this->any()) - ->method('getServer') - ->will($this->returnValue(new OauthClient())); + $filter->method('getServer') + ->willReturn(new OauthClient()); $filter->checkRateLimit(null, new Request(), null, null); } public function testCheckRateLimiterWithValidServerId() { - /** @var Connection|\PHPUnit_Framework_MockObject_MockObject $redis */ + /** @var Connection|\PHPUnit\Framework\MockObject\MockObject $redis */ $redis = $this->getMockBuilder(Connection::class) ->setMethods(['executeCommand']) ->getMock(); @@ -48,17 +49,16 @@ class RateLimiterTest extends TestCase { Yii::$app->set('redis', $redis); - /** @var Request|\PHPUnit_Framework_MockObject_MockObject $request */ + /** @var Request|\PHPUnit\Framework\MockObject\MockObject $request */ $request = $this->getMockBuilder(Request::class) ->setMethods(['getHostInfo']) ->getMock(); - $request->expects($this->any()) - ->method('getHostInfo') - ->will($this->returnValue('http://authserver.ely.by')); + $request->method('getHostInfo') + ->willReturn('http://authserver.ely.by'); $filter = new RateLimiter([ - 'authserverDomain' => Yii::$app->params['authserverHost'], + 'authserverDomain' => 'authserver.ely.by', ]); $filter->checkRateLimit(null, $request, null, null); } @@ -67,7 +67,7 @@ class RateLimiterTest extends TestCase { * @expectedException \yii\web\TooManyRequestsHttpException */ public function testCheckRateLimiter() { - /** @var Connection|\PHPUnit_Framework_MockObject_MockObject $redis */ + /** @var Connection|\PHPUnit\Framework\MockObject\MockObject $redis */ $redis = $this->getMockBuilder(Connection::class) ->setMethods(['executeCommand']) ->getMock(); @@ -78,27 +78,25 @@ class RateLimiterTest extends TestCase { Yii::$app->set('redis', $redis); - /** @var Request|\PHPUnit_Framework_MockObject_MockObject $request */ + /** @var Request|\PHPUnit\Framework\MockObject\MockObject $request */ $request = $this->getMockBuilder(Request::class) ->setMethods(['getUserIP']) ->getMock(); - $request->expects($this->any()) - ->method('getUserIp') - ->will($this->returnValue(Internet::localIpv4())); + $request->method('getUserIp') + ->willReturn(Internet::localIpv4()); - /** @var RateLimiter|\PHPUnit_Framework_MockObject_MockObject $filter */ + /** @var RateLimiter|\PHPUnit\Framework\MockObject\MockObject $filter */ $filter = $this->getMockBuilder(RateLimiter::class) ->setConstructorArgs([[ 'limit' => 3, - 'authserverDomain' => Yii::$app->params['authserverHost'], + 'authserverDomain' => 'authserver.ely.by', ]]) ->setMethods(['getServer']) ->getMock(); - $filter->expects($this->any()) - ->method('getServer') - ->will($this->returnValue(null)); + $filter->method('getServer') + ->willReturn(null); for ($i = 0; $i < 5; $i++) { $filter->checkRateLimit(null, $request, null, null); diff --git a/tests/codeception/api/unit/request/RequestParserTest.php b/api/tests/unit/request/RequestParserTest.php similarity index 87% rename from tests/codeception/api/unit/request/RequestParserTest.php rename to api/tests/unit/request/RequestParserTest.php index 8dbb3e0..97962b7 100644 --- a/tests/codeception/api/unit/request/RequestParserTest.php +++ b/api/tests/unit/request/RequestParserTest.php @@ -1,8 +1,8 @@ init([ ]); require __DIR__ . '/../../vendor/yiisoft/yii2/Yii.php'; -spl_autoload_unregister(['Yii', 'autoload']); require __DIR__ . '/../../common/config/bootstrap.php'; require __DIR__ . '/../config/bootstrap.php'; diff --git a/codeception.dist.yml b/codeception.dist.yml new file mode 100644 index 0000000..bac3dc2 --- /dev/null +++ b/codeception.dist.yml @@ -0,0 +1,10 @@ +include: + - common + - api + - console + +paths: + log: console/runtime/logs + +settings: + colors: true diff --git a/common/codeception.dist.yml b/common/codeception.dist.yml new file mode 100644 index 0000000..8874605 --- /dev/null +++ b/common/codeception.dist.yml @@ -0,0 +1,21 @@ +namespace: common\tests +actor_suffix: Tester +paths: + tests: tests + log: tests/_output + data: tests/_data + helpers: tests/_support +settings: + bootstrap: _bootstrap.php + colors: true + memory_limit: 1024M +coverage: + enabled: true + whitelist: + include: + - ./* + exclude: + - config/* + - mail/* + - codeception.dist.yml + - codeception.yml diff --git a/common/config/ConfigLoader.php b/common/config/ConfigLoader.php index c4bf229..58f4495 100644 --- a/common/config/ConfigLoader.php +++ b/common/config/ConfigLoader.php @@ -1,4 +1,6 @@ 'common-tests', + 'basePath' => dirname(__DIR__), + 'params' => [ + 'fromEmail' => 'ely@ely.by', + ], + 'components' => [ + 'security' => [ + // It's allows us to increase tests speed by decreasing password hashing algorithm complexity + 'passwordHashCost' => 4, + ], + 'queue' => [ + 'class' => common\tests\_support\queue\Queue::class, + ], + 'sentry' => [ + 'enabled' => false, + ], + 'mailer' => [ + 'useFileTransport' => true, + ], + ], +]; diff --git a/common/config/config.php b/common/config/config.php index cd71980..8e468c6 100644 --- a/common/config/config.php +++ b/common/config/config.php @@ -2,6 +2,24 @@ return [ 'version' => '{{PLACE_VERSION_HERE}}', // This will be replaced by build tool 'vendorPath' => dirname(__DIR__, 2) . '/vendor', + 'aliases' => [ + '@bower' => '@vendor/bower-asset', + '@npm' => '@vendor/npm-asset', + + '@root' => dirname(__DIR__, 2), + '@api' => '@root/api', + '@common' => '@root/common', + '@console' => '@root/console', + ], + 'params' => [ + 'fromEmail' => 'ely@ely.by', + 'supportEmail' => 'support@ely.by', + ], + 'container' => [ + 'definitions' => [ + GuzzleHttp\ClientInterface::class => GuzzleHttp\Client::class, + ], + ], 'components' => [ 'cache' => [ 'class' => yii\redis\Cache::class, @@ -91,13 +109,4 @@ return [ 'class' => yii\queue\redis\Queue::class, ], ], - 'container' => [ - 'definitions' => [ - GuzzleHttp\ClientInterface::class => GuzzleHttp\Client::class, - ], - ], - 'aliases' => [ - '@bower' => '@vendor/bower-asset', - '@npm' => '@vendor/npm-asset', - ], ]; diff --git a/common/config/params.php b/common/config/params.php deleted file mode 100644 index bc54b66..0000000 --- a/common/config/params.php +++ /dev/null @@ -1,5 +0,0 @@ - 'ely@ely.by', - 'supportEmail' => 'support@ely.by', -]; diff --git a/common/tests/.gitignore b/common/tests/.gitignore new file mode 100644 index 0000000..089cfd4 --- /dev/null +++ b/common/tests/.gitignore @@ -0,0 +1,2 @@ +unit.suite.yml +_support/_generated diff --git a/common/tests/_bootstrap.php b/common/tests/_bootstrap.php new file mode 100644 index 0000000..41318a6 --- /dev/null +++ b/common/tests/_bootstrap.php @@ -0,0 +1,8 @@ + 'Redis', + ]; + + public function _initialize(): void { + if (!$this->hasModule($this->config['module'])) { + throw new ModuleConfigException($this, 'This module should be used together with Redis module'); + } + + /** @var \Codeception\Module\Redis $module */ + $module = $this->getModule($this->config['module']); + $config = $module->_getConfig(); + $config['host'] = Yii::$app->redis->hostname; + $config['port'] = Yii::$app->redis->port; + $config['database'] = Yii::$app->redis->database; + $module->_setConfig($config); + if ($module->driver !== null) { + $module->_initialize(); + } + } + +} diff --git a/tests/codeception/common/_support/FixtureHelper.php b/common/tests/_support/FixtureHelper.php similarity index 77% rename from tests/codeception/common/_support/FixtureHelper.php rename to common/tests/_support/FixtureHelper.php index 6e5dfd0..17914cd 100644 --- a/tests/codeception/common/_support/FixtureHelper.php +++ b/common/tests/_support/FixtureHelper.php @@ -1,15 +1,15 @@ assertEquals('**@ely.by', StringHelper::getEmailMask('e@ely.by')); diff --git a/tests/codeception/common/unit/models/AccountSessionTest.php b/common/tests/unit/models/AccountSessionTest.php similarity index 90% rename from tests/codeception/common/unit/models/AccountSessionTest.php rename to common/tests/unit/models/AccountSessionTest.php index 0e98803..ca429f1 100644 --- a/tests/codeception/common/unit/models/AccountSessionTest.php +++ b/common/tests/unit/models/AccountSessionTest.php @@ -1,8 +1,8 @@ =5.4.0", - "psr/http-message": "~1.0" + "psr/http-message": "~1.0", + "ralouphie/getallheaders": "^2.0.5" }, "provide": { "psr/http-message-implementation": "1.0" }, "require-dev": { - "phpunit/phpunit": "~4.0" + "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4-dev" + "dev-master": "1.5-dev" } }, "autoload": { @@ -1080,13 +1081,14 @@ "keywords": [ "http", "message", + "psr-7", "request", "response", "stream", "uri", "url" ], - "time": "2017-03-20T17:10:46+00:00" + "time": "2018-12-04T20:46:45+00:00" }, { "name": "jakubledl/dissect", @@ -1522,6 +1524,46 @@ ], "time": "2016-08-06T14:39:51+00:00" }, + { + "name": "ralouphie/getallheaders", + "version": "2.0.5", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "reference": "5601c8a83fbba7ef674a7369456d12f1e0d0eafa", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "~3.7.0", + "satooshi/php-coveralls": ">=1.0" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "time": "2016-02-11T07:05:27+00:00" + }, { "name": "ramsey/uuid", "version": "3.7.3", @@ -1837,17 +1879,75 @@ "time": "2018-06-21T11:10:19+00:00" }, { - "name": "symfony/polyfill-mbstring", - "version": "v1.7.0", + "name": "symfony/polyfill-ctype", + "version": "v1.10.0", "source": { "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b" + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/78be803ce01e55d3491c1397cf1c64beb9c1b63b", - "reference": "78be803ce01e55d3491c1397cf1c64beb9c1b63b", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", + "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", + "shasum": "" + }, + "require": { + "php": ">=5.3.3" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.9-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + }, + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + }, + { + "name": "Gert de Pagter", + "email": "backendtea@gmail.com" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "time": "2018-08-06T14:22:27+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.10.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", + "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", "shasum": "" }, "require": { @@ -1859,7 +1959,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7-dev" + "dev-master": "1.9-dev" } }, "autoload": { @@ -1893,7 +1993,7 @@ "portable", "shim" ], - "time": "2018-01-30T19:27:44+00:00" + "time": "2018-09-21T13:07:52+00:00" }, { "name": "symfony/polyfill-php70", @@ -1956,16 +2056,16 @@ }, { "name": "symfony/process", - "version": "v4.0.4", + "version": "v4.2.3", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "e1712002d81de6f39f854bc5bbd9e9f4bb6345b4" + "reference": "6c05edb11fbeff9e2b324b4270ecb17911a8b7ad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/e1712002d81de6f39f854bc5bbd9e9f4bb6345b4", - "reference": "e1712002d81de6f39f854bc5bbd9e9f4bb6345b4", + "url": "https://api.github.com/repos/symfony/process/zipball/6c05edb11fbeff9e2b324b4270ecb17911a8b7ad", + "reference": "6c05edb11fbeff9e2b324b4270ecb17911a8b7ad", "shasum": "" }, "require": { @@ -1974,7 +2074,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -2001,24 +2101,25 @@ ], "description": "Symfony Process Component", "homepage": "https://symfony.com", - "time": "2018-01-29T09:06:29+00:00" + "time": "2019-01-24T22:05:03+00:00" }, { "name": "webmozart/assert", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a" + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/0df1908962e7a3071564e857d86874dad1ef204a", - "reference": "0df1908962e7a3071564e857d86874dad1ef204a", + "url": "https://api.github.com/repos/webmozart/assert/zipball/83e253c8e0be5b0257b881e1827274667c5c17a9", + "reference": "83e253c8e0be5b0257b881e1827274667c5c17a9", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^5.3.3 || ^7.0", + "symfony/polyfill-ctype": "^1.8" }, "require-dev": { "phpunit/phpunit": "^4.6", @@ -2051,7 +2152,7 @@ "check", "validate" ], - "time": "2018-01-29T19:49:41+00:00" + "time": "2018-12-25T11:19:39+00:00" }, { "name": "yiisoft/yii2", @@ -2392,16 +2493,16 @@ "packages-dev": [ { "name": "behat/gherkin", - "version": "v4.4.5", + "version": "v4.6.0", "source": { "type": "git", "url": "https://github.com/Behat/Gherkin.git", - "reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74" + "reference": "ab0a02ea14893860bca00f225f5621d351a3ad07" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Behat/Gherkin/zipball/5c14cff4f955b17d20d088dec1bde61c0539ec74", - "reference": "5c14cff4f955b17d20d088dec1bde61c0539ec74", + "url": "https://api.github.com/repos/Behat/Gherkin/zipball/ab0a02ea14893860bca00f225f5621d351a3ad07", + "reference": "ab0a02ea14893860bca00f225f5621d351a3ad07", "shasum": "" }, "require": { @@ -2409,8 +2510,8 @@ }, "require-dev": { "phpunit/phpunit": "~4.5|~5", - "symfony/phpunit-bridge": "~2.7|~3", - "symfony/yaml": "~2.3|~3" + "symfony/phpunit-bridge": "~2.7|~3|~4", + "symfony/yaml": "~2.3|~3|~4" }, "suggest": { "symfony/yaml": "If you want to parse features, represented in YAML files" @@ -2447,7 +2548,7 @@ "gherkin", "parser" ], - "time": "2016-10-30T11:50:56+00:00" + "time": "2019-01-16T14:22:17+00:00" }, { "name": "bower-asset/bootstrap", @@ -2473,31 +2574,29 @@ }, { "name": "codeception/codeception", - "version": "2.3.8", + "version": "2.5.3", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "43eade17a8cd68e9cde401e8585b09d11d41b12d" + "reference": "19f0fe845c0af5af2a6c094dc0df3a178a3fd5b0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/43eade17a8cd68e9cde401e8585b09d11d41b12d", - "reference": "43eade17a8cd68e9cde401e8585b09d11d41b12d", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/19f0fe845c0af5af2a6c094dc0df3a178a3fd5b0", + "reference": "19f0fe845c0af5af2a6c094dc0df3a178a3fd5b0", "shasum": "" }, "require": { - "behat/gherkin": "~4.4.0", - "codeception/stub": "^1.0", + "behat/gherkin": "^4.4.0", + "codeception/phpunit-wrapper": "^6.0.9|^7.0.6", + "codeception/stub": "^2.0", + "ext-curl": "*", "ext-json": "*", "ext-mbstring": "*", "facebook/webdriver": ">=1.1.3 <2.0", "guzzlehttp/guzzle": ">=4.1.4 <7.0", "guzzlehttp/psr7": "~1.0", - "php": ">=5.4.0 <8.0", - "phpunit/php-code-coverage": ">=2.2.4 <6.0", - "phpunit/phpunit": ">=4.8.28 <5.0.0 || >=5.6.3 <7.0", - "sebastian/comparator": ">1.1 <3.0", - "sebastian/diff": ">=1.4 <3.0", + "php": ">=5.6.0 <8.0", "symfony/browser-kit": ">=2.7 <5.0", "symfony/console": ">=2.7 <5.0", "symfony/css-selector": ">=2.7 <5.0", @@ -2516,7 +2615,7 @@ "predis/predis": "^1.0", "squizlabs/php_codesniffer": "~2.0", "symfony/process": ">=2.7 <5.0", - "vlucas/phpdotenv": "^2.4.0" + "vlucas/phpdotenv": "^3.0" }, "suggest": { "aws/aws-sdk-php": "For using AWS Auth in REST module and Queue module", @@ -2539,7 +2638,7 @@ }, "autoload": { "psr-4": { - "Codeception\\": "src\\Codeception", + "Codeception\\": "src/Codeception", "Codeception\\Extension\\": "ext" } }, @@ -2563,7 +2662,53 @@ "functional testing", "unit testing" ], - "time": "2018-01-27T22:47:33+00:00" + "time": "2019-02-02T15:39:58+00:00" + }, + { + "name": "codeception/phpunit-wrapper", + "version": "6.5.1", + "source": { + "type": "git", + "url": "https://github.com/Codeception/phpunit-wrapper.git", + "reference": "d78f9eb9c4300a5924cc27dee03e8c1a96fcf5f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/d78f9eb9c4300a5924cc27dee03e8c1a96fcf5f3", + "reference": "d78f9eb9c4300a5924cc27dee03e8c1a96fcf5f3", + "shasum": "" + }, + "require": { + "phpunit/php-code-coverage": ">=4.0.4 <6.0", + "phpunit/phpunit": ">=6.5.13 <7.0", + "sebastian/comparator": ">=1.2.4 <3.0", + "sebastian/diff": ">=1.4 <4.0" + }, + "replace": { + "codeception/phpunit-wrapper": "*" + }, + "require-dev": { + "codeception/specify": "*", + "vlucas/phpdotenv": "^2.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Codeception\\PHPUnit\\": "src\\" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Davert", + "email": "davert.php@resend.cc" + } + ], + "description": "PHPUnit classes used by Codeception", + "time": "2019-01-13T10:34:55+00:00" }, { "name": "codeception/specify", @@ -2605,22 +2750,19 @@ }, { "name": "codeception/stub", - "version": "1.0.2", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/Codeception/Stub.git", - "reference": "95fb7a36b81890dd2e5163e7ab31310df6f1bb99" + "reference": "f50bc271f392a2836ff80690ce0c058efe1ae03e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Stub/zipball/95fb7a36b81890dd2e5163e7ab31310df6f1bb99", - "reference": "95fb7a36b81890dd2e5163e7ab31310df6f1bb99", + "url": "https://api.github.com/repos/Codeception/Stub/zipball/f50bc271f392a2836ff80690ce0c058efe1ae03e", + "reference": "f50bc271f392a2836ff80690ce0c058efe1ae03e", "shasum": "" }, "require": { - "phpunit/phpunit-mock-objects": ">2.3 <7.0" - }, - "require-dev": { "phpunit/phpunit": ">=4.8 <8.0" }, "type": "library", @@ -2634,7 +2776,7 @@ "MIT" ], "description": "Flexible Stub wrapper for PHPUnit's Mock Builder", - "time": "2018-02-18T13:56:56+00:00" + "time": "2018-07-26T11:55:37+00:00" }, { "name": "codeception/verify", @@ -2887,34 +3029,39 @@ }, { "name": "facebook/webdriver", - "version": "1.5.0", + "version": "1.6.0", "source": { "type": "git", "url": "https://github.com/facebook/php-webdriver.git", - "reference": "86b5ca2f67173c9d34340845dd690149c886a605" + "reference": "bd8c740097eb9f2fc3735250fc1912bc811a954e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/86b5ca2f67173c9d34340845dd690149c886a605", - "reference": "86b5ca2f67173c9d34340845dd690149c886a605", + "url": "https://api.github.com/repos/facebook/php-webdriver/zipball/bd8c740097eb9f2fc3735250fc1912bc811a954e", + "reference": "bd8c740097eb9f2fc3735250fc1912bc811a954e", "shasum": "" }, "require": { "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", "ext-zip": "*", "php": "^5.6 || ~7.0", "symfony/process": "^2.8 || ^3.1 || ^4.0" }, "require-dev": { "friendsofphp/php-cs-fixer": "^2.0", - "guzzle/guzzle": "^3.4.1", - "php-coveralls/php-coveralls": "^1.0.2", + "jakub-onderka/php-parallel-lint": "^0.9.2", + "php-coveralls/php-coveralls": "^2.0", "php-mock/php-mock-phpunit": "^1.1", "phpunit/phpunit": "^5.7", "sebastian/environment": "^1.3.4 || ^2.0 || ^3.0", "squizlabs/php_codesniffer": "^2.6", "symfony/var-dumper": "^3.3 || ^4.0" }, + "suggest": { + "ext-SimpleXML": "For Firefox profile creation" + }, "type": "library", "extra": { "branch-alias": { @@ -2938,7 +3085,7 @@ "selenium", "webdriver" ], - "time": "2017-11-15T11:08:09+00:00" + "time": "2018-05-16T17:37:13+00:00" }, { "name": "flow/jsonpath", @@ -3237,25 +3384,28 @@ }, { "name": "myclabs/deep-copy", - "version": "1.7.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", + "reference": "3e01bdad3e18354c3dce54466b7fbe33a9f9f7f8", "shasum": "" }, "require": { - "php": "^5.6 || ^7.0" + "php": "^7.1" + }, + "replace": { + "myclabs/deep-copy": "self.version" }, "require-dev": { "doctrine/collections": "^1.0", "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" + "phpunit/phpunit": "^7.1" }, "type": "library", "autoload": { @@ -3278,7 +3428,7 @@ "object", "object graph" ], - "time": "2017-10-19T19:58:43+00:00" + "time": "2018-06-11T23:09:50+00:00" }, { "name": "phar-io/manifest", @@ -3756,33 +3906,33 @@ }, { "name": "phpspec/prophecy", - "version": "1.7.5", + "version": "1.8.0", "source": { "type": "git", "url": "https://github.com/phpspec/prophecy.git", - "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401" + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/dfd6be44111a7c41c2e884a336cc4f461b3b2401", - "reference": "dfd6be44111a7c41c2e884a336cc4f461b3b2401", + "url": "https://api.github.com/repos/phpspec/prophecy/zipball/4ba436b55987b4bf311cb7c6ba82aa528aac0a06", + "reference": "4ba436b55987b4bf311cb7c6ba82aa528aac0a06", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", "php": "^5.3|^7.0", "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0", - "sebastian/comparator": "^1.1|^2.0", + "sebastian/comparator": "^1.1|^2.0|^3.0", "sebastian/recursion-context": "^1.0|^2.0|^3.0" }, "require-dev": { "phpspec/phpspec": "^2.5|^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5" + "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { @@ -3815,20 +3965,20 @@ "spy", "stub" ], - "time": "2018-02-19T10:16:54+00:00" + "time": "2018-08-05T17:53:17+00:00" }, { "name": "phpunit/php-code-coverage", - "version": "5.3.0", + "version": "5.3.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1" + "reference": "c89677919c5dd6d3b3852f230a663118762218ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/661f34d0bd3f1a7225ef491a70a020ad23a057a1", - "reference": "661f34d0bd3f1a7225ef491a70a020ad23a057a1", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", + "reference": "c89677919c5dd6d3b3852f230a663118762218ac", "shasum": "" }, "require": { @@ -3878,7 +4028,7 @@ "testing", "xunit" ], - "time": "2017-12-06T09:29:45+00:00" + "time": "2018-04-06T15:36:58+00:00" }, { "name": "phpunit/php-file-iterator", @@ -4068,16 +4218,16 @@ }, { "name": "phpunit/phpunit", - "version": "6.5.6", + "version": "6.5.14", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "3330ef26ade05359d006041316ed0fa9e8e3cefe" + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/3330ef26ade05359d006041316ed0fa9e8e3cefe", - "reference": "3330ef26ade05359d006041316ed0fa9e8e3cefe", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", "shasum": "" }, "require": { @@ -4095,7 +4245,7 @@ "phpunit/php-file-iterator": "^1.4.3", "phpunit/php-text-template": "^1.2.1", "phpunit/php-timer": "^1.0.9", - "phpunit/phpunit-mock-objects": "^5.0.5", + "phpunit/phpunit-mock-objects": "^5.0.9", "sebastian/comparator": "^2.1", "sebastian/diff": "^2.0", "sebastian/environment": "^3.1", @@ -4148,20 +4298,20 @@ "testing", "xunit" ], - "time": "2018-02-01T05:57:37+00:00" + "time": "2019-02-01T05:22:47+00:00" }, { "name": "phpunit/phpunit-mock-objects", - "version": "5.0.6", + "version": "5.0.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf" + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/33fd41a76e746b8fa96d00b49a23dadfa8334cdf", - "reference": "33fd41a76e746b8fa96d00b49a23dadfa8334cdf", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", + "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", "shasum": "" }, "require": { @@ -4174,7 +4324,7 @@ "phpunit/phpunit": "<6.0" }, "require-dev": { - "phpunit/phpunit": "^6.5" + "phpunit/phpunit": "^6.5.11" }, "suggest": { "ext-soap": "*" @@ -4207,7 +4357,7 @@ "mock", "xunit" ], - "time": "2018-01-06T05:45:45+00:00" + "time": "2018-08-09T05:50:03+00:00" }, { "name": "predis/predis", @@ -5034,16 +5184,16 @@ }, { "name": "symfony/browser-kit", - "version": "v4.0.4", + "version": "v4.2.3", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "fee0fcd501304b1c3190f6293f650cceb738a353" + "reference": "ee4462581eb54bf34b746e4a5d522a4f21620160" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/fee0fcd501304b1c3190f6293f650cceb738a353", - "reference": "fee0fcd501304b1c3190f6293f650cceb738a353", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/ee4462581eb54bf34b746e4a5d522a4f21620160", + "reference": "ee4462581eb54bf34b746e4a5d522a4f21620160", "shasum": "" }, "require": { @@ -5060,7 +5210,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -5087,30 +5237,34 @@ ], "description": "Symfony BrowserKit Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2019-01-16T21:31:25+00:00" }, { "name": "symfony/console", - "version": "v4.0.4", + "version": "v4.2.3", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "36d5b41e7d4e1ccf0370f6babe966c08ef0a1488" + "reference": "1f0ad51dfde4da8a6070f06adc58b4e37cbb37a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/36d5b41e7d4e1ccf0370f6babe966c08ef0a1488", - "reference": "36d5b41e7d4e1ccf0370f6babe966c08ef0a1488", + "url": "https://api.github.com/repos/symfony/console/zipball/1f0ad51dfde4da8a6070f06adc58b4e37cbb37a4", + "reference": "1f0ad51dfde4da8a6070f06adc58b4e37cbb37a4", "shasum": "" }, "require": { "php": "^7.1.3", + "symfony/contracts": "^1.0", "symfony/polyfill-mbstring": "~1.0" }, "conflict": { "symfony/dependency-injection": "<3.4", "symfony/process": "<3.3" }, + "provide": { + "psr/log-implementation": "1.0" + }, "require-dev": { "psr/log": "~1.0", "symfony/config": "~3.4|~4.0", @@ -5128,7 +5282,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -5155,20 +5309,88 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2018-01-29T09:06:29+00:00" + "time": "2019-01-25T14:35:16+00:00" }, { - "name": "symfony/css-selector", - "version": "v4.0.4", + "name": "symfony/contracts", + "version": "v1.0.2", "source": { "type": "git", - "url": "https://github.com/symfony/css-selector.git", - "reference": "f97600434e3141ef3cbb9ea42cf500fba88022b7" + "url": "https://github.com/symfony/contracts.git", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/f97600434e3141ef3cbb9ea42cf500fba88022b7", - "reference": "f97600434e3141ef3cbb9ea42cf500fba88022b7", + "url": "https://api.github.com/repos/symfony/contracts/zipball/1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "reference": "1aa7ab2429c3d594dd70689604b5cf7421254cdf", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "require-dev": { + "psr/cache": "^1.0", + "psr/container": "^1.0" + }, + "suggest": { + "psr/cache": "When using the Cache contracts", + "psr/container": "When using the Service contracts", + "symfony/cache-contracts-implementation": "", + "symfony/service-contracts-implementation": "", + "symfony/translation-contracts-implementation": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\": "" + }, + "exclude-from-classmap": [ + "**/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A set of abstractions extracted out of the Symfony components", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "time": "2018-12-05T08:06:11+00:00" + }, + { + "name": "symfony/css-selector", + "version": "v4.2.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/css-selector.git", + "reference": "48eddf66950fa57996e1be4a55916d65c10c604a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/48eddf66950fa57996e1be4a55916d65c10c604a", + "reference": "48eddf66950fa57996e1be4a55916d65c10c604a", "shasum": "" }, "require": { @@ -5177,7 +5399,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -5208,24 +5430,25 @@ ], "description": "Symfony CssSelector Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2019-01-16T20:31:39+00:00" }, { "name": "symfony/dom-crawler", - "version": "v4.0.4", + "version": "v4.2.3", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "39b785e1cf28e9f21bb601a5d62c4992a8e8a290" + "reference": "d8476760b04cdf7b499c8718aa437c20a9155103" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/39b785e1cf28e9f21bb601a5d62c4992a8e8a290", - "reference": "39b785e1cf28e9f21bb601a5d62c4992a8e8a290", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/d8476760b04cdf7b499c8718aa437c20a9155103", + "reference": "d8476760b04cdf7b499c8718aa437c20a9155103", "shasum": "" }, "require": { "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8", "symfony/polyfill-mbstring": "~1.0" }, "require-dev": { @@ -5237,7 +5460,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -5264,24 +5487,25 @@ ], "description": "Symfony DomCrawler Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2019-01-16T20:35:37+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v4.0.4", + "version": "v4.2.3", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "74d33aac36208c4d6757807d9f598f0133a3a4eb" + "reference": "bd09ad265cd50b2b9d09d65ce6aba2d29bc81fe1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/74d33aac36208c4d6757807d9f598f0133a3a4eb", - "reference": "74d33aac36208c4d6757807d9f598f0133a3a4eb", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/bd09ad265cd50b2b9d09d65ce6aba2d29bc81fe1", + "reference": "bd09ad265cd50b2b9d09d65ce6aba2d29bc81fe1", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1.3", + "symfony/contracts": "^1.0" }, "conflict": { "symfony/dependency-injection": "<3.4" @@ -5300,7 +5524,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -5327,7 +5551,7 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2019-01-16T20:35:37+00:00" }, { "name": "symfony/filesystem", @@ -5380,16 +5604,16 @@ }, { "name": "symfony/finder", - "version": "v4.0.4", + "version": "v4.2.3", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "8b08180f2b7ccb41062366b9ad91fbc4f1af8601" + "reference": "ef71816cbb264988bb57fe6a73f610888b9aa70c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/8b08180f2b7ccb41062366b9ad91fbc4f1af8601", - "reference": "8b08180f2b7ccb41062366b9ad91fbc4f1af8601", + "url": "https://api.github.com/repos/symfony/finder/zipball/ef71816cbb264988bb57fe6a73f610888b9aa70c", + "reference": "ef71816cbb264988bb57fe6a73f610888b9aa70c", "shasum": "" }, "require": { @@ -5398,7 +5622,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -5425,7 +5649,7 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2018-01-03T07:38:00+00:00" + "time": "2019-01-16T20:35:37+00:00" }, { "name": "symfony/options-resolver", @@ -5587,20 +5811,21 @@ }, { "name": "symfony/yaml", - "version": "v4.0.4", + "version": "v4.2.3", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "ffc60bda1d4a00ec0b32eeabf39dc017bf480028" + "reference": "d461670ee145092b7e2a56c1da7118f19cadadb0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/ffc60bda1d4a00ec0b32eeabf39dc017bf480028", - "reference": "ffc60bda1d4a00ec0b32eeabf39dc017bf480028", + "url": "https://api.github.com/repos/symfony/yaml/zipball/d461670ee145092b7e2a56c1da7118f19cadadb0", + "reference": "d461670ee145092b7e2a56c1da7118f19cadadb0", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" }, "conflict": { "symfony/console": "<3.4" @@ -5614,7 +5839,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -5641,7 +5866,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2018-01-21T19:06:11+00:00" + "time": "2019-01-16T20:35:37+00:00" }, { "name": "theseer/tokenizer", @@ -5847,7 +6072,8 @@ "prefer-stable": false, "prefer-lowest": false, "platform": { - "php": "^7.1" + "php": "^7.2", + "ext-json": "*" }, "platform-dev": [] } diff --git a/console/codeception.dist.yml b/console/codeception.dist.yml new file mode 100644 index 0000000..673cb42 --- /dev/null +++ b/console/codeception.dist.yml @@ -0,0 +1,23 @@ +namespace: console\tests +actor_suffix: Tester +paths: + tests: tests + log: tests/_output + data: tests/_data + helpers: tests/_support +settings: + bootstrap: _bootstrap.php + colors: true + memory_limit: 1024M +coverage: + enabled: true + whitelist: + include: + - ./* + exclude: + - config/* + - runtime/* + - migrations/* + - views/* + - codeception.dist.yml + - codeception.yml diff --git a/console/config/config.php b/console/config/config.php index be4d94e..06eba95 100644 --- a/console/config/config.php +++ b/console/config/config.php @@ -1,15 +1,9 @@ 'accounts-console', 'basePath' => dirname(__DIR__), 'bootstrap' => ['log', 'queue'], 'controllerNamespace' => 'console\controllers', - 'params' => $params, 'components' => [ 'log' => [ 'targets' => [ diff --git a/console/config/params.php b/console/config/params.php deleted file mode 100644 index d0b9c34..0000000 --- a/console/config/params.php +++ /dev/null @@ -1,3 +0,0 @@ - fixtures\EmailActivationFixture::class, 'minecraftSessions' => fixtures\MinecraftAccessKeyFixture::class, diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 7854586..b58867a 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -1,82 +1,136 @@ version: '2' services: - app: - image: registry.ely.by/elyby/accounts:dev - build: - context: . - args: - build_env: dev - depends_on: - - db - - redis - volumes: - - ./:/var/www/html/ - env_file: .env + app: + image: registry.ely.by/elyby/accounts:dev + build: + context: . + args: + build_env: dev + depends_on: + - db + - redis + volumes: + - ./:/var/www/html/ + env_file: .env - worker: - image: registry.ely.by/elyby/accounts:dev - build: - context: . - args: - build_env: dev - command: ['php', 'yii', 'queue/listen', '-v'] - depends_on: - - db - - redis - volumes: - - ./:/var/www/html/ - env_file: .env + worker: + image: registry.ely.by/elyby/accounts:dev + build: + context: . + args: + build_env: dev + command: ['php', 'yii', 'queue/listen', '-v'] + depends_on: + - db + - redis + volumes: + - ./:/var/www/html/ + env_file: .env - cron: - image: registry.ely.by/elyby/accounts:dev - build: - context: . - args: - build_env: dev - command: ['crond', '-s', '/etc/cron.d', '-f', '-L', '/var/log/cron.log'] - depends_on: - - db - - redis - volumes: - - ./:/var/www/html/ - env_file: .env + cron: + image: registry.ely.by/elyby/accounts:dev + build: + context: . + args: + build_env: dev + command: ['crond', '-s', '/etc/cron.d', '-f', '-L', '/var/log/cron.log'] + stop_signal: SIGKILL + depends_on: + - db + - redis + volumes: + - ./:/var/www/html/ + env_file: .env - web: - image: registry.ely.by/elyby/accounts-nginx:latest - volumes_from: - - app - links: - - app:php - env_file: .env - networks: - - default - - nginx-proxy + web: + image: registry.ely.by/elyby/accounts-nginx:latest + volumes_from: + - app + links: + - app:php + env_file: .env + networks: + - default + - nginx-proxy - db: - build: ./docker/mariadb - env_file: .env - volumes: - - ./data/mysql:/var/lib/mysql + db: + build: ./docker/mariadb + env_file: .env + volumes: + - ./data/mysql:/var/lib/mysql - redis: - image: redis:3.0-alpine - volumes: - - ./data/redis:/data + redis: + image: redis:3.0-alpine + volumes: + - ./data/redis:/data - phpmyadmin: - build: ./docker/phpmyadmin - environment: - - PMA_ARBITRARY=1 - - PMA_USER=root - - PMA_PASSWORD= - - VIRTUAL_HOST=pma.account.ely.by.local - depends_on: - - db - networks: - - default - - nginx-proxy + # If you want to use separate databases for the tests follow the next steps: + # 1) Create a file common/config/config-local.php with the next containment: + # + # [ + # 'db' => [ + # 'dsn' => 'mysql:host=testdb;dbname=test', + # 'username' => 'test', + # 'password' => 'test', + # ], + # 'unbufferedDb' => [ + # 'dsn' => 'mysql:host=testdb;dbname=test', + # 'username' => 'test', + # 'password' => 'test', + # ], + # 'redis' => [ + # 'hostname' => 'testredis', + # 'password' => null, + # 'port' => 6379, + # 'database' => 0, + # ], + # ], + # ]; + # + # 2) Clone api/tests/functional.suite.dist.yml into api/test/functional.suite.yml + # and adjust Redis module host value to the "testredis". + # + # 3) Uncomment the next 2 services (testdb and testredis): + # + # testdb: + # build: ./docker/mariadb + # volumes: + # - ./data/mysql-test:/var/lib/mysql + # environment: + # - MYSQL_ALLOW_EMPTY_PASSWORD=yes + # - MYSQL_ROOT_PASSWORD= + # - MYSQL_DATABASE=test + # - MYSQL_USER=test + # - MYSQL_PASSWORD=test + # + # testredis: + # image: redis:3.0-alpine + # volumes: + # - ./data/redis-test:/data + # + # 4) To run migrations on tests database you must execute slightly adjusted + # migrate command: env YII_ENV=test yii migrate + + phpmyadmin: + build: ./docker/phpmyadmin + environment: + - PMA_ARBITRARY=1 + - PMA_USER=root + - PMA_PASSWORD= + - VIRTUAL_HOST=pma.account.ely.by.local # Feel free to adjust this domain + depends_on: + - db + networks: + - default + - nginx-proxy networks: - nginx-proxy: - external: - name: nginx-proxy + nginx-proxy: + external: + name: nginx-proxy diff --git a/docker-compose.prod.yml b/docker-compose.prod.yml index 687baab..6b0f928 100644 --- a/docker-compose.prod.yml +++ b/docker-compose.prod.yml @@ -1,57 +1,58 @@ version: '2' services: - app: - image: registry.ely.by/elyby/accounts:latest - restart: always - depends_on: - - db - - redis - env_file: .env + app: + image: registry.ely.by/elyby/accounts:latest + restart: always + depends_on: + - db + - redis + env_file: .env - worker: - image: registry.ely.by/elyby/accounts:latest - restart: always - command: ['php', 'yii', 'queue/listen', '-v'] - depends_on: - - db - - redis - env_file: .env + worker: + image: registry.ely.by/elyby/accounts:latest + restart: always + command: ['php', 'yii', 'queue/listen', '-v'] + depends_on: + - db + - redis + env_file: .env - worker: - image: registry.ely.by/elyby/accounts:latest - restart: always - command: ['crond', '-s', '/etc/cron.d', '-f', '-L', '/var/log/cron.log'] - depends_on: - - db - - redis - env_file: .env + cron: + image: registry.ely.by/elyby/accounts:latest + restart: always + command: ['crond', '-s', '/etc/cron.d', '-f', '-L', '/var/log/cron.log'] + stop_signal: SIGKILL + depends_on: + - db + - redis + env_file: .env - web: - image: registry.ely.by/elyby/accounts-nginx:1.0.3 - restart: always - volumes_from: - - app - links: - - app:php - env_file: .env - networks: - - default - - nginx-proxy + web: + image: registry.ely.by/elyby/accounts-nginx:1.0.3 + restart: always + volumes_from: + - app + links: + - app:php + env_file: .env + networks: + - default + - nginx-proxy - db: - build: ./docker/mariadb - restart: always - env_file: .env - volumes: - - ./data/mysql:/var/lib/mysql + db: + build: ./docker/mariadb + restart: always + env_file: .env + volumes: + - ./data/mysql:/var/lib/mysql - redis: - image: redis:3.0-alpine - restart: always - volumes: - - ./data/redis:/data + redis: + image: redis:3.0-alpine + restart: always + volumes: + - ./data/redis:/data networks: - nginx-proxy: - external: - name: nginx-proxy + nginx-proxy: + external: + name: nginx-proxy diff --git a/tests/.gitignore b/tests/.gitignore deleted file mode 100644 index c40b483..0000000 --- a/tests/.gitignore +++ /dev/null @@ -1 +0,0 @@ -.bash_history diff --git a/tests/codeception.yml b/tests/codeception.yml deleted file mode 100644 index d6db419..0000000 --- a/tests/codeception.yml +++ /dev/null @@ -1,10 +0,0 @@ -include: - - codeception/common - - codeception/console - - codeception/api - -paths: - log: codeception/_output - -settings: - colors: true diff --git a/tests/codeception/api/.gitignore b/tests/codeception/api/.gitignore deleted file mode 100644 index 3217386..0000000 --- a/tests/codeception/api/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# these files are auto generated by codeception build -_support/_generated diff --git a/tests/codeception/api/_bootstrap.php b/tests/codeception/api/_bootstrap.php deleted file mode 100644 index 3bd1f3c..0000000 --- a/tests/codeception/api/_bootstrap.php +++ /dev/null @@ -1,23 +0,0 @@ -getActor()->sendPOST('/authserver/authentication/authenticate', $params); - } - - public function refresh($params) { - $this->getActor()->sendPOST('/authserver/authentication/refresh', $params); - } - - public function validate($params) { - $this->getActor()->sendPOST('/authserver/authentication/validate', $params); - } - - public function invalidate($params) { - $this->getActor()->sendPOST('/authserver/authentication/invalidate', $params); - } - - public function signout($params) { - $this->getActor()->sendPOST('/authserver/authentication/signout', $params); - } - -} diff --git a/tests/codeception/api/_pages/IdentityInfoRoute.php b/tests/codeception/api/_pages/IdentityInfoRoute.php deleted file mode 100644 index c3a8ed4..0000000 --- a/tests/codeception/api/_pages/IdentityInfoRoute.php +++ /dev/null @@ -1,10 +0,0 @@ -getActor()->sendGET('/account/v1/info'); - } - -} diff --git a/tests/codeception/api/_pages/InternalRoute.php b/tests/codeception/api/_pages/InternalRoute.php deleted file mode 100644 index ceacfb8..0000000 --- a/tests/codeception/api/_pages/InternalRoute.php +++ /dev/null @@ -1,10 +0,0 @@ -getActor()->sendGET('/internal/accounts/info', [$param => $value]); - } - -} diff --git a/tests/codeception/api/_pages/OauthRoute.php b/tests/codeception/api/_pages/OauthRoute.php deleted file mode 100644 index 11b5e18..0000000 --- a/tests/codeception/api/_pages/OauthRoute.php +++ /dev/null @@ -1,42 +0,0 @@ -getActor()->sendGET('/oauth2/v1/validate', $queryParams); - } - - public function complete(array $queryParams = [], array $postParams = []): void { - $this->getActor()->sendPOST('/oauth2/v1/complete?' . http_build_query($queryParams), $postParams); - } - - public function issueToken(array $postParams = []): void { - $this->getActor()->sendPOST('/oauth2/v1/token', $postParams); - } - - public function createClient(string $type, array $postParams): void { - $this->getActor()->sendPOST('/v1/oauth2/' . $type, $postParams); - } - - public function updateClient(string $clientId, array $params): void { - $this->getActor()->sendPUT('/v1/oauth2/' . $clientId, $params); - } - - public function deleteClient(string $clientId): void { - $this->getActor()->sendDELETE('/v1/oauth2/' . $clientId); - } - - public function resetClient(string $clientId, bool $regenerateSecret = false): void { - $this->getActor()->sendPOST("/v1/oauth2/$clientId/reset" . ($regenerateSecret ? '?regenerateSecret' : '')); - } - - public function getClient(string $clientId): void { - $this->getActor()->sendGET("/v1/oauth2/$clientId"); - } - - public function getPerAccount(int $accountId): void { - $this->getActor()->sendGET("/v1/accounts/$accountId/oauth2/clients"); - } - -} diff --git a/tests/codeception/api/_pages/OptionsRoute.php b/tests/codeception/api/_pages/OptionsRoute.php deleted file mode 100644 index 9413aeb..0000000 --- a/tests/codeception/api/_pages/OptionsRoute.php +++ /dev/null @@ -1,10 +0,0 @@ -getActor()->sendGET('/options'); - } - -} diff --git a/tests/codeception/api/_pages/SessionServerRoute.php b/tests/codeception/api/_pages/SessionServerRoute.php deleted file mode 100644 index 5d34346..0000000 --- a/tests/codeception/api/_pages/SessionServerRoute.php +++ /dev/null @@ -1,26 +0,0 @@ -getActor()->sendPOST('/minecraft/session/join', $params); - } - - public function joinLegacy(array $params) { - $this->getActor()->sendGET('/minecraft/session/legacy/join', $params); - } - - public function hasJoined(array $params) { - $this->getActor()->sendGET('/minecraft/session/hasJoined', $params); - } - - public function hasJoinedLegacy(array $params) { - $this->getActor()->sendGET('/minecraft/session/legacy/hasJoined', $params); - } - - public function profile($profileUuid) { - $this->getActor()->sendGET("/minecraft/session/profile/{$profileUuid}"); - } - -} diff --git a/tests/codeception/api/codeception.yml b/tests/codeception/api/codeception.yml deleted file mode 100644 index 406850d..0000000 --- a/tests/codeception/api/codeception.yml +++ /dev/null @@ -1,27 +0,0 @@ -namespace: tests\codeception\api -actor: Tester -params: [env] -paths: - tests: . - log: _output - data: _data - helpers: _support -settings: - bootstrap: _bootstrap.php - suite_class: \PHPUnit_Framework_TestSuite - colors: true - memory_limit: 1024M - log: true -config: - test_entry_url: http://localhost/api/web/index.php -coverage: - enabled: true - remote: true - whitelist: - include: - - ../../../api/* - exclude: - - ../../../api/config/* - - ../../../api/web/* - - ../../../api/runtime/* - c3url: 'http://localhost/api/web/index.php' diff --git a/tests/codeception/api/functional.suite.yml b/tests/codeception/api/functional.suite.yml deleted file mode 100644 index 570a025..0000000 --- a/tests/codeception/api/functional.suite.yml +++ /dev/null @@ -1,22 +0,0 @@ -class_name: FunctionalTester -modules: - enabled: - - Filesystem - - Yii2 - - tests\codeception\common\_support\FixtureHelper - - tests\codeception\common\_support\Mockery - - Redis - - Asserts - - REST: - depends: Yii2 - url: /api - config: - Yii2: - configFile: '../config/api/functional.php' - cleanup: true - transaction: false - Redis: - host: "%REDIS_HOST%" - port: 6379 - database: 0 - cleanupBefore: 'test' diff --git a/tests/codeception/api/unit.suite.yml b/tests/codeception/api/unit.suite.yml deleted file mode 100644 index beea248..0000000 --- a/tests/codeception/api/unit.suite.yml +++ /dev/null @@ -1,12 +0,0 @@ -class_name: UnitTester -modules: - enabled: - - Yii2: - part: [orm, email, fixtures] - - tests\codeception\common\_support\queue\CodeceptionQueueHelper - - tests\codeception\common\_support\Mockery - config: - Yii2: - configFile: '../config/api/unit.php' - cleanup: true - transaction: false diff --git a/tests/codeception/bin/_bootstrap.php b/tests/codeception/bin/_bootstrap.php deleted file mode 100644 index abbeded..0000000 --- a/tests/codeception/bin/_bootstrap.php +++ /dev/null @@ -1,9 +0,0 @@ -run(); -exit($exitCode); diff --git a/tests/codeception/common/.gitignore b/tests/codeception/common/.gitignore deleted file mode 100644 index 3217386..0000000 --- a/tests/codeception/common/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# these files are auto generated by codeception build -_support/_generated diff --git a/tests/codeception/common/_bootstrap.php b/tests/codeception/common/_bootstrap.php deleted file mode 100644 index a75fbc6..0000000 --- a/tests/codeception/common/_bootstrap.php +++ /dev/null @@ -1,13 +0,0 @@ - 'app-common', - 'basePath' => dirname(__DIR__), - ] -); diff --git a/tests/codeception/config/config.php b/tests/codeception/config/config.php deleted file mode 100644 index 72c5fa3..0000000 --- a/tests/codeception/config/config.php +++ /dev/null @@ -1,30 +0,0 @@ - 'en-US', - 'controllerMap' => [ - 'fixture' => [ - 'class' => yii\faker\FixtureController::class, - 'fixtureDataPath' => '@tests/codeception/common/fixtures/data', - 'templatePath' => '@tests/codeception/common/templates/fixtures', - 'namespace' => 'tests\codeception\common\fixtures', - ], - ], - 'params' => [ - 'fromEmail' => 'ely@ely.by', - ], - 'components' => [ - 'urlManager' => [ - 'showScriptName' => true, - ], - 'security' => [ - // Для тестов нам не сильно важна безопасность, а вот время прохождения тестов значительно сокращается - 'passwordHashCost' => 4, - ], - 'queue' => [ - 'class' => tests\codeception\common\_support\queue\Queue::class, - ], - 'sentry' => [ - 'enabled' => false, - ], - ], -]; diff --git a/tests/codeception/config/console/unit.php b/tests/codeception/config/console/unit.php deleted file mode 100644 index b0ad993..0000000 --- a/tests/codeception/config/console/unit.php +++ /dev/null @@ -1,6 +0,0 @@ - [ - 'request' => [ - // it's not recommended to run functional tests with CSRF validation enabled - 'enableCsrfValidation' => false, - 'enableCookieValidation' => false, - // but if you absolutely need it set cookie domain to localhost - ], - ], -]; diff --git a/tests/codeception/config/unit.php b/tests/codeception/config/unit.php deleted file mode 100644 index bee73cf..0000000 --- a/tests/codeception/config/unit.php +++ /dev/null @@ -1,4 +0,0 @@ - Date: Fri, 22 Feb 2019 23:19:52 +0300 Subject: [PATCH 4/7] Fix backend CI configuration --- .gitlab-ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6fda076..7935c49 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -47,9 +47,9 @@ test backend: - sudo rm /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini script: - composer install - - php tests/codeception/bin/yii rbac/generate - - ./docker/php/wait-for-it.sh "${DB_HOST}:3306" -s -t 0 -- "php tests/codeception/bin/yii migrate/up --interactive=0" - - vendor/bin/codecept run -c tests + - php yii rbac/generate + - ./docker/php/wait-for-it.sh "${DB_HOST}:3306" -s -t 0 -- "php yii migrate/up --interactive=0" + - vendor/bin/codecept run test frontend: image: node:9.2.1-alpine From 1cafa36b9818a8043f54f4b1eb3ffbb138607705 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Sat, 23 Feb 2019 02:11:57 +0300 Subject: [PATCH 5/7] Fix codestyle --- .php_cs.dist | 1 + api/tests/functional/LoginCest.php | 2 +- api/tests/functional/RegisterCest.php | 2 +- api/tests/functional/_steps/AuthserverSteps.php | 2 +- api/tests/functional/_steps/SessionServerSteps.php | 4 ++-- api/tests/functional/accounts/BanCest.php | 2 +- api/tests/functional/accounts/ChangePasswordCest.php | 2 +- api/tests/functional/accounts/ChangeUsernameCest.php | 2 +- .../functional/accounts/DisableTwoFactorAuthCest.php | 2 +- api/tests/functional/accounts/EnableTwoFactorAuthCest.php | 2 +- api/tests/functional/accounts/PardonCest.php | 2 +- api/tests/functional/authserver/AuthorizationCest.php | 2 +- api/tests/functional/authserver/InvalidateCest.php | 2 +- api/tests/functional/authserver/RefreshCest.php | 2 +- api/tests/functional/authserver/ValidateCest.php | 2 +- .../functional/mojang/UuidToUsernamesHistoryCest.php | 2 +- api/tests/functional/oauth/AuthCodeCest.php | 2 +- api/tests/functional/oauth/RefreshTokenCest.php | 2 +- api/tests/functional/sessionserver/HasJoinedCest.php | 2 +- .../functional/sessionserver/HasJoinedLegacyCest.php | 2 +- api/tests/functional/sessionserver/JoinCest.php | 4 ++-- api/tests/functional/sessionserver/JoinLegacyCest.php | 4 ++-- api/tests/functional/sessionserver/ProfileCest.php | 2 +- api/tests/unit/components/ReCaptcha/ValidatorTest.php | 2 +- api/tests/unit/components/User/ComponentTest.php | 8 ++++---- .../unit/components/User/JwtAuthenticationResultTest.php | 2 +- api/tests/unit/models/FeedbackFormTest.php | 2 +- api/tests/unit/models/JwtIdentityTest.php | 6 +++--- .../unit/models/authentication/ConfirmEmailFormTest.php | 2 +- .../unit/models/authentication/ForgotPasswordFormTest.php | 4 ++-- api/tests/unit/models/authentication/LoginFormTest.php | 4 ++-- api/tests/unit/models/authentication/LogoutFormTest.php | 2 +- .../models/authentication/RecoverPasswordFormTest.php | 2 +- .../unit/models/authentication/RefreshTokenFormTest.php | 2 +- .../unit/models/authentication/RegistrationFormTest.php | 4 ++-- .../authentication/RepeatAccountActivationFormTest.php | 4 ++-- .../unit/modules/accounts/models/AcceptRulesFormTest.php | 2 +- .../unit/modules/accounts/models/ChangeEmailFormTest.php | 2 +- .../modules/accounts/models/ChangeLanguageFormTest.php | 2 +- .../modules/accounts/models/ChangePasswordFormTest.php | 2 +- .../modules/accounts/models/ChangeUsernameFormTest.php | 2 +- .../accounts/models/DisableTwoFactorAuthFormTest.php | 2 +- .../accounts/models/EnableTwoFactorAuthFormTest.php | 2 +- .../accounts/models/SendEmailVerificationFormTest.php | 2 +- .../accounts/models/SendNewEmailVerificationFormTest.php | 2 +- .../modules/accounts/models/TwoFactorAuthInfoTest.php | 2 +- .../modules/authserver/models/AuthenticationFormTest.php | 4 ++-- api/tests/unit/modules/internal/models/BanFormTest.php | 2 +- api/tests/unit/modules/internal/models/PardonFormTest.php | 2 +- .../unit/modules/oauth/models/ApplicationTypeTest.php | 2 +- .../unit/modules/oauth/models/BaseOauthClientTypeTest.php | 2 +- .../unit/modules/oauth/models/MinecraftServerTypeTest.php | 2 +- .../modules/oauth/models/OauthClientFormFactoryTest.php | 2 +- .../unit/modules/oauth/models/OauthClientFormTest.php | 2 +- .../unit/modules/session/filters/RateLimiterTest.php | 2 +- api/tests/unit/traits/AccountFinderTest.php | 2 +- .../unit/validators/EmailActivationKeyValidatorTest.php | 2 +- .../unit/validators/PasswordRequiredValidatorTest.php | 2 +- api/tests/unit/validators/TotpValidatorTest.php | 4 ++-- common/tests/unit/components/Mojang/ApiTest.php | 2 +- common/tests/unit/emails/TemplateWithRendererTest.php | 2 +- common/tests/unit/tasks/DeliveryWebHookTest.php | 2 +- common/tests/unit/validators/EmailValidatorTest.php | 2 +- common/tests/unit/validators/LanguageValidatorTest.php | 2 +- .../validators/MinecraftServerAddressValidatorTest.php | 2 +- common/tests/unit/validators/UsernameValidatorTest.php | 2 +- common/tests/unit/validators/UuidValidatorTest.php | 2 +- 67 files changed, 81 insertions(+), 80 deletions(-) diff --git a/.php_cs.dist b/.php_cs.dist index a8fc27d..2fca0ef 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -5,6 +5,7 @@ $finder = \PhpCsFixer\Finder::create() ->exclude('docker') ->exclude('frontend') ->notPath('common/emails/views') + ->notPath('common/mail/layouts') ->notPath('/.*\/runtime/') ->notPath('autocompletion.php') ->notPath('tests/codeception/_output') diff --git a/api/tests/functional/LoginCest.php b/api/tests/functional/LoginCest.php index e92573a..f1abfe7 100644 --- a/api/tests/functional/LoginCest.php +++ b/api/tests/functional/LoginCest.php @@ -1,9 +1,9 @@ Date: Sat, 23 Feb 2019 17:15:20 +0300 Subject: [PATCH 6/7] Update dependencies --- .../SendNewEmailVerificationFormTest.php | 2 +- composer.json | 13 +- composer.lock | 1327 +++++++---------- 3 files changed, 576 insertions(+), 766 deletions(-) diff --git a/api/tests/unit/modules/accounts/models/SendNewEmailVerificationFormTest.php b/api/tests/unit/modules/accounts/models/SendNewEmailVerificationFormTest.php index aaaa1b5..64023c7 100644 --- a/api/tests/unit/modules/accounts/models/SendNewEmailVerificationFormTest.php +++ b/api/tests/unit/modules/accounts/models/SendNewEmailVerificationFormTest.php @@ -50,7 +50,7 @@ class SendNewEmailVerificationFormTest extends TestCase { 'account_id' => $account->id, 'type' => EmailActivation::TYPE_NEW_EMAIL_CONFIRMATION, ]); - $this->assertNotNull(EmailActivation::class, $activation); + $this->assertInstanceOf(EmailActivation::class, $activation); /** @var SendNewEmailConfirmation $job */ $job = $this->tester->grabLastQueuedJob(); diff --git a/composer.json b/composer.json index 7592f70..9f4e12a 100644 --- a/composer.json +++ b/composer.json @@ -24,7 +24,7 @@ "bacon/bacon-qr-code": "^1.0", "paragonie/constant_time_encoding": "^2.0", "webmozart/assert": "^1.2.0", - "goaop/framework": "~2.2.0", + "goaop/framework": "^2.2.0", "domnikl/statsd": "^2.6", "yiisoft/yii2-queue": "~2.1.0" }, @@ -32,17 +32,22 @@ "yiisoft/yii2-debug": "*", "yiisoft/yii2-faker": "*", "flow/jsonpath": "^0.4.0", - "phpunit/phpunit": "^6.0", - "codeception/codeception": "2.5.3", + "codeception/codeception": "^2.5.3", "codeception/specify": "^1.0.0", "codeception/verify": "*", "mockery/mockery": "^1.0.0", "php-mock/php-mock-mockery": "^1.2.0", - "friendsofphp/php-cs-fixer": "^2.11", "ely/php-code-style": "^0.1.0", "predis/predis": "^1.1", "roave/security-advisories": "dev-master" }, + "replace": { + "paragonie/random_compat": "2.99.99", + "symfony/polyfill-ctype": "*", + "symfony/polyfill-mbstring": "*", + "symfony/polyfill-php70": "*", + "symfony/polyfill-php72": "*" + }, "repositories": [ { "type": "composer", diff --git a/composer.lock b/composer.lock index 988e6bd..c989311 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "8ba515912f6d4e82e2368739d95c950b", + "content-hash": "c0a5d0472eaecefbba5199888a4232ae", "packages": [ { "name": "bacon/bacon-qr-code", @@ -54,25 +54,25 @@ }, { "name": "beberlei/assert", - "version": "v2.9.2", + "version": "v3.2.0", "source": { "type": "git", "url": "https://github.com/beberlei/assert.git", - "reference": "2d555f72f3f4ff9e72a7bc17cb8a53c86737c8a0" + "reference": "fd82f4c8592c8128dd74481034c31da71ebafc56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/beberlei/assert/zipball/2d555f72f3f4ff9e72a7bc17cb8a53c86737c8a0", - "reference": "2d555f72f3f4ff9e72a7bc17cb8a53c86737c8a0", + "url": "https://api.github.com/repos/beberlei/assert/zipball/fd82f4c8592c8128dd74481034c31da71ebafc56", + "reference": "fd82f4c8592c8128dd74481034c31da71ebafc56", "shasum": "" }, "require": { - "ext-mbstring": "*", - "php": ">=5.3" + "php": "^7" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^2.1.1", - "phpunit/phpunit": "^4.8.35|^5.7" + "friendsofphp/php-cs-fixer": "*", + "phpstan/phpstan-shim": "*", + "phpunit/phpunit": "*" }, "type": "library", "autoload": { @@ -105,7 +105,7 @@ "assertion", "validation" ], - "time": "2018-01-25T13:33:16+00:00" + "time": "2018-12-24T15:25:25+00:00" }, { "name": "bower-asset/inputmask", @@ -166,16 +166,16 @@ }, { "name": "bower-asset/raven-js", - "version": "3.22.2", + "version": "3.27.0", "source": { "type": "git", "url": "git@github.com:getsentry/raven-js-bower.git", - "reference": "f8eec063c95f70d8978f895284946bd278748d97" + "reference": "c8b3a6040be6928e2f57fa5eec4d7afc31750235" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/raven-js-bower/zipball/f8eec063c95f70d8978f895284946bd278748d97", - "reference": "f8eec063c95f70d8978f895284946bd278748d97", + "url": "https://api.github.com/repos/getsentry/raven-js-bower/zipball/c8b3a6040be6928e2f57fa5eec4d7afc31750235", + "reference": "c8b3a6040be6928e2f57fa5eec4d7afc31750235", "shasum": null }, "type": "bower-asset" @@ -264,16 +264,16 @@ }, { "name": "daveearley/daves-email-validation-tool", - "version": "v0.1.9", + "version": "v0.1.12", "source": { "type": "git", "url": "https://github.com/daveearley/Email-Validation-Tool.git", - "reference": "a5942e5387dfdd259a9f8e3ba53bc089a77cf7ee" + "reference": "c9e8a340638cbabe05962fe1b2ea7ef79e1a529f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/daveearley/Email-Validation-Tool/zipball/a5942e5387dfdd259a9f8e3ba53bc089a77cf7ee", - "reference": "a5942e5387dfdd259a9f8e3ba53bc089a77cf7ee", + "url": "https://api.github.com/repos/daveearley/Email-Validation-Tool/zipball/c9e8a340638cbabe05962fe1b2ea7ef79e1a529f", + "reference": "c9e8a340638cbabe05962fe1b2ea7ef79e1a529f", "shasum": "" }, "require": { @@ -308,7 +308,7 @@ "email verification", "validate email" ], - "time": "2018-02-01T17:47:27+00:00" + "time": "2018-04-13T00:48:04+00:00" }, { "name": "doctrine/annotations", @@ -380,16 +380,16 @@ }, { "name": "doctrine/cache", - "version": "v1.7.1", + "version": "v1.8.0", "source": { "type": "git", "url": "https://github.com/doctrine/cache.git", - "reference": "b3217d58609e9c8e661cd41357a54d926c4a2a1a" + "reference": "d768d58baee9a4862ca783840eca1b9add7a7f57" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/cache/zipball/b3217d58609e9c8e661cd41357a54d926c4a2a1a", - "reference": "b3217d58609e9c8e661cd41357a54d926c4a2a1a", + "url": "https://api.github.com/repos/doctrine/cache/zipball/d768d58baee9a4862ca783840eca1b9add7a7f57", + "reference": "d768d58baee9a4862ca783840eca1b9add7a7f57", "shasum": "" }, "require": { @@ -400,8 +400,9 @@ }, "require-dev": { "alcaeus/mongo-php-adapter": "^1.1", + "doctrine/coding-standard": "^4.0", "mongodb/mongodb": "^1.1", - "phpunit/phpunit": "^5.7", + "phpunit/phpunit": "^7.0", "predis/predis": "~1.0" }, "suggest": { @@ -410,7 +411,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.7.x-dev" + "dev-master": "1.8.x-dev" } }, "autoload": { @@ -445,12 +446,12 @@ } ], "description": "Caching library offering an object-oriented API for many cache backends", - "homepage": "http://www.doctrine-project.org", + "homepage": "https://www.doctrine-project.org", "keywords": [ "cache", "caching" ], - "time": "2017-08-25T07:02:50+00:00" + "time": "2018-08-21T18:01:43+00:00" }, { "name": "doctrine/lexer", @@ -508,16 +509,16 @@ }, { "name": "domnikl/statsd", - "version": "2.9.0", + "version": "2.10.0", "source": { "type": "git", "url": "https://github.com/domnikl/statsd-php.git", - "reference": "529578b05e455280fbb2748bb0080026d86452bb" + "reference": "0118ac4b576b86d87a072100e4ed921c6204d831" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/domnikl/statsd-php/zipball/529578b05e455280fbb2748bb0080026d86452bb", - "reference": "529578b05e455280fbb2748bb0080026d86452bb", + "url": "https://api.github.com/repos/domnikl/statsd-php/zipball/0118ac4b576b86d87a072100e4ed921c6204d831", + "reference": "0118ac4b576b86d87a072100e4ed921c6204d831", "shasum": "" }, "require": { @@ -551,20 +552,20 @@ "statsd", "udp" ], - "time": "2018-04-29T18:04:03+00:00" + "time": "2018-12-14T19:39:29+00:00" }, { "name": "egulias/email-validator", - "version": "2.1.3", + "version": "2.1.7", "source": { "type": "git", "url": "https://github.com/egulias/EmailValidator.git", - "reference": "1bec00a10039b823cc94eef4eddd47dcd3b2ca04" + "reference": "709f21f92707308cdf8f9bcfa1af4cb26586521e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/1bec00a10039b823cc94eef4eddd47dcd3b2ca04", - "reference": "1bec00a10039b823cc94eef4eddd47dcd3b2ca04", + "url": "https://api.github.com/repos/egulias/EmailValidator/zipball/709f21f92707308cdf8f9bcfa1af4cb26586521e", + "reference": "709f21f92707308cdf8f9bcfa1af4cb26586521e", "shasum": "" }, "require": { @@ -573,7 +574,7 @@ }, "require-dev": { "dominicsayers/isemail": "dev-master", - "phpunit/phpunit": "^4.8.35", + "phpunit/phpunit": "^4.8.35||^5.7||^6.0", "satooshi/php-coveralls": "^1.0.1" }, "suggest": { @@ -608,7 +609,7 @@ "validation", "validator" ], - "time": "2017-11-15T23:40:40+00:00" + "time": "2018-12-04T22:38:24+00:00" }, { "name": "ely/email-renderer", @@ -745,16 +746,16 @@ }, { "name": "ezyang/htmlpurifier", - "version": "v4.9.3", + "version": "v4.10.0", "source": { "type": "git", "url": "https://github.com/ezyang/htmlpurifier.git", - "reference": "95e1bae3182efc0f3422896a3236e991049dac69" + "reference": "d85d39da4576a6934b72480be6978fb10c860021" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/95e1bae3182efc0f3422896a3236e991049dac69", - "reference": "95e1bae3182efc0f3422896a3236e991049dac69", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/d85d39da4576a6934b72480be6978fb10c860021", + "reference": "d85d39da4576a6934b72480be6978fb10c860021", "shasum": "" }, "require": { @@ -788,28 +789,29 @@ "keywords": [ "html" ], - "time": "2017-06-03T02:28:16+00:00" + "time": "2018-02-23T01:58:20+00:00" }, { "name": "goaop/framework", - "version": "2.2.0", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/goaop/framework.git", - "reference": "152abbffffcba72d2d159b892deb40b0829d0f28" + "reference": "00cf1d7271b9746411646500c83348f0b30bfe28" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/goaop/framework/zipball/152abbffffcba72d2d159b892deb40b0829d0f28", - "reference": "152abbffffcba72d2d159b892deb40b0829d0f28", + "url": "https://api.github.com/repos/goaop/framework/zipball/00cf1d7271b9746411646500c83348f0b30bfe28", + "reference": "00cf1d7271b9746411646500c83348f0b30bfe28", "shasum": "" }, "require": { "doctrine/annotations": "^1.2.3", "doctrine/cache": "^1.5", - "goaop/parser-reflection": "~1.4", + "goaop/parser-reflection": "~2.0", "jakubledl/dissect": "~1.0", - "php": ">=5.6.0" + "php": ">=5.6.0", + "symfony/finder": "^3.4|^4.2" }, "require-dev": { "adlawson/vfs": "^0.12", @@ -854,25 +856,25 @@ "library", "php" ], - "time": "2018-01-05T23:07:51+00:00" + "time": "2019-01-05T21:55:35+00:00" }, { "name": "goaop/parser-reflection", - "version": "1.4.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/goaop/parser-reflection.git", - "reference": "adfc38fee63014880932ebcc4810871b8e33edc9" + "reference": "a71d0454ef8bfa416a39bbb7dd3ed497e063e54c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/goaop/parser-reflection/zipball/adfc38fee63014880932ebcc4810871b8e33edc9", - "reference": "adfc38fee63014880932ebcc4810871b8e33edc9", + "url": "https://api.github.com/repos/goaop/parser-reflection/zipball/a71d0454ef8bfa416a39bbb7dd3ed497e063e54c", + "reference": "a71d0454ef8bfa416a39bbb7dd3ed497e063e54c", "shasum": "" }, "require": { - "nikic/php-parser": "^1.2|^2.0|^3.0", - "php": ">=5.6.0" + "nikic/php-parser": "^4.0", + "php": ">=7.0" }, "require-dev": { "phpunit/phpunit": "~4.0" @@ -880,7 +882,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-master": "2.x-dev" } }, "autoload": { @@ -905,7 +907,7 @@ } ], "description": "Provides reflection information, based on raw source", - "time": "2017-09-03T14:59:13+00:00" + "time": "2018-12-12T18:50:29+00:00" }, { "name": "guzzlehttp/guzzle", @@ -1147,16 +1149,16 @@ }, { "name": "league/event", - "version": "2.1.2", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/thephpleague/event.git", - "reference": "e4bfc88dbcb60c8d8a2939a71f9813e141bbe4cd" + "reference": "d2cc124cf9a3fab2bb4ff963307f60361ce4d119" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/event/zipball/e4bfc88dbcb60c8d8a2939a71f9813e141bbe4cd", - "reference": "e4bfc88dbcb60c8d8a2939a71f9813e141bbe4cd", + "url": "https://api.github.com/repos/thephpleague/event/zipball/d2cc124cf9a3fab2bb4ff963307f60361ce4d119", + "reference": "d2cc124cf9a3fab2bb4ff963307f60361ce4d119", "shasum": "" }, "require": { @@ -1164,7 +1166,7 @@ }, "require-dev": { "henrikbjorn/phpspec-code-coverage": "~1.0.1", - "phpspec/phpspec": "~2.0.0" + "phpspec/phpspec": "^2.2" }, "type": "library", "extra": { @@ -1193,20 +1195,20 @@ "event", "listener" ], - "time": "2015-05-21T12:24:47+00:00" + "time": "2018-11-26T11:52:41+00:00" }, { "name": "league/oauth2-server", - "version": "4.1.6", + "version": "4.1.7", "source": { "type": "git", "url": "https://github.com/thephpleague/oauth2-server.git", - "reference": "3bec591393b1cc6a3fc02c94d18262e4ffad2e4f" + "reference": "138524984ac472652c69399529a35b6595cf22d3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/3bec591393b1cc6a3fc02c94d18262e4ffad2e4f", - "reference": "3bec591393b1cc6a3fc02c94d18262e4ffad2e4f", + "url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/138524984ac472652c69399529a35b6595cf22d3", + "reference": "138524984ac472652c69399529a35b6595cf22d3", "shasum": "" }, "require": { @@ -1257,7 +1259,7 @@ "secure", "server" ], - "time": "2016-09-13T13:42:53+00:00" + "time": "2018-06-23T16:27:31+00:00" }, { "name": "mito/yii2-sentry", @@ -1315,24 +1317,24 @@ }, { "name": "nikic/php-parser", - "version": "v3.1.4", + "version": "v4.2.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "e57b3a09784f846411aa7ed664eedb73e3399078" + "reference": "5221f49a608808c1e4d436df32884cbc1b821ac0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/e57b3a09784f846411aa7ed664eedb73e3399078", - "reference": "e57b3a09784f846411aa7ed664eedb73e3399078", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/5221f49a608808c1e4d436df32884cbc1b821ac0", + "reference": "5221f49a608808c1e4d436df32884cbc1b821ac0", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=5.5" + "php": ">=7.0" }, "require-dev": { - "phpunit/phpunit": "~4.0|~5.0" + "phpunit/phpunit": "^6.5 || ^7.0" }, "bin": [ "bin/php-parse" @@ -1340,7 +1342,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.0-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -1362,20 +1364,20 @@ "parser", "php" ], - "time": "2018-01-25T21:31:33+00:00" + "time": "2019-02-16T20:54:15+00:00" }, { "name": "paragonie/constant_time_encoding", - "version": "v2.2.2", + "version": "v2.2.3", "source": { "type": "git", "url": "https://github.com/paragonie/constant_time_encoding.git", - "reference": "eccf915f45f911bfb189d1d1638d940ec6ee6e33" + "reference": "55af0dc01992b4d0da7f6372e2eac097bbbaffdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/eccf915f45f911bfb189d1d1638d940ec6ee6e33", - "reference": "eccf915f45f911bfb189d1d1638d940ec6ee6e33", + "url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/55af0dc01992b4d0da7f6372e2eac097bbbaffdb", + "reference": "55af0dc01992b4d0da7f6372e2eac097bbbaffdb", "shasum": "" }, "require": { @@ -1383,7 +1385,7 @@ }, "require-dev": { "phpunit/phpunit": "^6|^7", - "vimeo/psalm": "^1" + "vimeo/psalm": "^1|^2" }, "type": "library", "autoload": { @@ -1424,55 +1426,7 @@ "hex2bin", "rfc4648" ], - "time": "2018-03-10T19:47:49+00:00" - }, - { - "name": "paragonie/random_compat", - "version": "v2.0.11", - "source": { - "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/5da4d3c796c275c55f057af5a643ae297d96b4d8", - "reference": "5da4d3c796c275c55f057af5a643ae297d96b4d8", - "shasum": "" - }, - "require": { - "php": ">=5.2.0" - }, - "require-dev": { - "phpunit/phpunit": "4.*|5.*" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." - }, - "type": "library", - "autoload": { - "files": [ - "lib/random.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "pseudorandom", - "random" - ], - "time": "2017-09-27T21:40:39+00:00" + "time": "2019-01-03T20:26:31+00:00" }, { "name": "psr/http-message", @@ -1566,21 +1520,22 @@ }, { "name": "ramsey/uuid", - "version": "3.7.3", + "version": "3.8.0", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "44abcdad877d9a46685a3a4d221e3b2c4b87cb76" + "reference": "d09ea80159c1929d75b3f9c60504d613aeb4a1e3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/44abcdad877d9a46685a3a4d221e3b2c4b87cb76", - "reference": "44abcdad877d9a46685a3a4d221e3b2c4b87cb76", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/d09ea80159c1929d75b3f9c60504d613aeb4a1e3", + "reference": "d09ea80159c1929d75b3f9c60504d613aeb4a1e3", "shasum": "" }, "require": { - "paragonie/random_compat": "^1.0|^2.0", - "php": "^5.4 || ^7.0" + "paragonie/random_compat": "^1.0|^2.0|9.99.99", + "php": "^5.4 || ^7.0", + "symfony/polyfill-ctype": "^1.8" }, "replace": { "rhumsaa/uuid": "self.version" @@ -1588,16 +1543,17 @@ "require-dev": { "codeception/aspect-mock": "^1.0 | ~2.0.0", "doctrine/annotations": "~1.2.0", - "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ^2.1", + "goaop/framework": "1.0.0-alpha.2 | ^1.0 | ~2.1.0", "ircmaxell/random-lib": "^1.1", "jakub-onderka/php-parallel-lint": "^0.9.0", "mockery/mockery": "^0.9.9", "moontoast/math": "^1.1", "php-mock/php-mock-phpunit": "^0.3|^1.1", - "phpunit/phpunit": "^4.7|^5.0", + "phpunit/phpunit": "^4.7|^5.0|^6.5", "squizlabs/php_codesniffer": "^2.3" }, "suggest": { + "ext-ctype": "Provides support for PHP Ctype functions", "ext-libsodium": "Provides the PECL libsodium extension for use with the SodiumRandomGenerator", "ext-uuid": "Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator", "ircmaxell/random-lib": "Provides RandomLib for use with the RandomLibAdapter", @@ -1642,20 +1598,20 @@ "identifier", "uuid" ], - "time": "2018-01-20T00:28:24+00:00" + "time": "2018-07-19T23:38:55+00:00" }, { "name": "sentry/sentry", - "version": "1.8.3", + "version": "1.10.0", "source": { "type": "git", "url": "https://github.com/getsentry/sentry-php.git", - "reference": "512661046e403dc5eb5ae192d5a6cda10e068a95" + "reference": "b2b8ffe1560b9fb0110b02993594a4b04a511959" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/512661046e403dc5eb5ae192d5a6cda10e068a95", - "reference": "512661046e403dc5eb5ae192d5a6cda10e068a95", + "url": "https://api.github.com/repos/getsentry/sentry-php/zipball/b2b8ffe1560b9fb0110b02993594a4b04a511959", + "reference": "b2b8ffe1560b9fb0110b02993594a4b04a511959", "shasum": "" }, "require": { @@ -1682,7 +1638,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.9.x-dev" + "dev-master": "1.10.x-dev" } }, "autoload": { @@ -1706,24 +1662,24 @@ "log", "logging" ], - "time": "2018-02-07T11:26:52+00:00" + "time": "2018-11-09T12:27:19+00:00" }, { "name": "spomky-labs/otphp", - "version": "v9.1.0", + "version": "v9.1.3", "source": { "type": "git", "url": "https://github.com/Spomky-Labs/otphp.git", - "reference": "4b303e33972f6c886f32b38fea60f41be6d74ec1" + "reference": "68c70d3b5bf6e851d44651af7de5a0b171bb3d11" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Spomky-Labs/otphp/zipball/4b303e33972f6c886f32b38fea60f41be6d74ec1", - "reference": "4b303e33972f6c886f32b38fea60f41be6d74ec1", + "url": "https://api.github.com/repos/Spomky-Labs/otphp/zipball/68c70d3b5bf6e851d44651af7de5a0b171bb3d11", + "reference": "68c70d3b5bf6e851d44651af7de5a0b171bb3d11", "shasum": "" }, "require": { - "beberlei/assert": "^2.4", + "beberlei/assert": "^2.4|^3.0", "paragonie/constant_time_encoding": "^2.0", "php": "^7.1" }, @@ -1767,20 +1723,20 @@ "otp", "totp" ], - "time": "2018-02-26T13:45:15+00:00" + "time": "2019-01-06T14:05:41+00:00" }, { "name": "swiftmailer/swiftmailer", - "version": "v6.0.2", + "version": "v6.1.3", "source": { "type": "git", "url": "https://github.com/swiftmailer/swiftmailer.git", - "reference": "412333372fb6c8ffb65496a2bbd7321af75733fc" + "reference": "8ddcb66ac10c392d3beb54829eef8ac1438595f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/412333372fb6c8ffb65496a2bbd7321af75733fc", - "reference": "412333372fb6c8ffb65496a2bbd7321af75733fc", + "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/8ddcb66ac10c392d3beb54829eef8ac1438595f4", + "reference": "8ddcb66ac10c392d3beb54829eef8ac1438595f4", "shasum": "" }, "require": { @@ -1791,10 +1747,14 @@ "mockery/mockery": "~0.9.1", "symfony/phpunit-bridge": "~3.3@dev" }, + "suggest": { + "ext-intl": "Needed to support internationalized email addresses", + "true/punycode": "Needed to support internationalized email addresses, if ext-intl is not installed" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "6.0-dev" + "dev-master": "6.1-dev" } }, "autoload": { @@ -1816,26 +1776,75 @@ } ], "description": "Swiftmailer, free feature-rich PHP mailer", - "homepage": "http://swiftmailer.symfony.com", + "homepage": "https://swiftmailer.symfony.com", "keywords": [ "email", "mail", "mailer" ], - "time": "2017-09-30T22:39:41+00:00" + "time": "2018-09-11T07:12:52+00:00" }, { - "name": "symfony/http-foundation", - "version": "v3.4.12", + "name": "symfony/finder", + "version": "v4.2.3", "source": { "type": "git", - "url": "https://github.com/symfony/http-foundation.git", - "reference": "1c28679fcbb0d9b35e4fd49fbb74d2ca4ea17bce" + "url": "https://github.com/symfony/finder.git", + "reference": "ef71816cbb264988bb57fe6a73f610888b9aa70c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/1c28679fcbb0d9b35e4fd49fbb74d2ca4ea17bce", - "reference": "1c28679fcbb0d9b35e4fd49fbb74d2ca4ea17bce", + "url": "https://api.github.com/repos/symfony/finder/zipball/ef71816cbb264988bb57fe6a73f610888b9aa70c", + "reference": "ef71816cbb264988bb57fe6a73f610888b9aa70c", + "shasum": "" + }, + "require": { + "php": "^7.1.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.2-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony Finder Component", + "homepage": "https://symfony.com", + "time": "2019-01-16T20:35:37+00:00" + }, + { + "name": "symfony/http-foundation", + "version": "v3.4.22", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-foundation.git", + "reference": "9a81d2330ea255ded06a69b4f7fb7804836e7a05" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/9a81d2330ea255ded06a69b4f7fb7804836e7a05", + "reference": "9a81d2330ea255ded06a69b4f7fb7804836e7a05", "shasum": "" }, "require": { @@ -1876,183 +1885,7 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2018-06-21T11:10:19+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.10.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e3d826245268269cd66f8326bd8bc066687b4a19", - "reference": "e3d826245268269cd66f8326bd8bc066687b4a19", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - }, - { - "name": "Gert de Pagter", - "email": "backendtea@gmail.com" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "time": "2018-08-06T14:22:27+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.10.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494", - "reference": "c79c051f5b3a46be09205c73b80b346e4153e494", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.9-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2018-09-21T13:07:52+00:00" - }, - { - "name": "symfony/polyfill-php70", - "version": "v1.7.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "3532bfcd8f933a7816f3a0a59682fc404776600f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/3532bfcd8f933a7816f3a0a59682fc404776600f", - "reference": "3532bfcd8f933a7816f3a0a59682fc404776600f", - "shasum": "" - }, - "require": { - "paragonie/random_compat": "~1.0|~2.0", - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php70\\": "" - }, - "files": [ - "bootstrap.php" - ], - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2018-01-30T19:27:44+00:00" + "time": "2019-01-27T09:04:14+00:00" }, { "name": "symfony/process", @@ -2256,16 +2089,16 @@ }, { "name": "yiisoft/yii2-composer", - "version": "2.0.5", + "version": "2.0.7", "source": { "type": "git", "url": "https://github.com/yiisoft/yii2-composer.git", - "reference": "3f4923c2bde6caf3f5b88cc22fdd5770f52f8df2" + "reference": "1439e78be1218c492e6cde251ed87d3f128b9534" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/3f4923c2bde6caf3f5b88cc22fdd5770f52f8df2", - "reference": "3f4923c2bde6caf3f5b88cc22fdd5770f52f8df2", + "url": "https://api.github.com/repos/yiisoft/yii2-composer/zipball/1439e78be1218c492e6cde251ed87d3f128b9534", + "reference": "1439e78be1218c492e6cde251ed87d3f128b9534", "shasum": "" }, "require": { @@ -2294,6 +2127,10 @@ { "name": "Qiang Xue", "email": "qiang.xue@gmail.com" + }, + { + "name": "Carsten Brandt", + "email": "mail@cebe.cc" } ], "description": "The composer plugin for Yii extension installer", @@ -2302,7 +2139,7 @@ "extension installer", "yii2" ], - "time": "2016-12-20T13:26:02+00:00" + "time": "2018-07-05T15:44:47+00:00" }, { "name": "yiisoft/yii2-queue", @@ -2390,16 +2227,16 @@ }, { "name": "yiisoft/yii2-redis", - "version": "2.0.8", + "version": "2.0.9", "source": { "type": "git", "url": "https://github.com/yiisoft/yii2-redis.git", - "reference": "ffe6bff8dc6be4bb84c9495cd3ef7ef1161c1314" + "reference": "29c3ae9f1e1f61d9ab326f92fcacb03218c218dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/yiisoft/yii2-redis/zipball/ffe6bff8dc6be4bb84c9495cd3ef7ef1161c1314", - "reference": "ffe6bff8dc6be4bb84c9495cd3ef7ef1161c1314", + "url": "https://api.github.com/repos/yiisoft/yii2-redis/zipball/29c3ae9f1e1f61d9ab326f92fcacb03218c218dc", + "reference": "29c3ae9f1e1f61d9ab326f92fcacb03218c218dc", "shasum": "" }, "require": { @@ -2437,25 +2274,25 @@ "session", "yii2" ], - "time": "2018-03-20T11:01:04+00:00" + "time": "2018-09-23T22:34:46+00:00" }, { "name": "yiisoft/yii2-swiftmailer", - "version": "2.1.1", + "version": "2.1.2", "source": { "type": "git", "url": "https://github.com/yiisoft/yii2-swiftmailer.git", - "reference": "fd917fbe63b7ea796c52902143b83b98e65bfb73" + "reference": "09659a55959f9e64b8178d842b64a9ffae42b994" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/yiisoft/yii2-swiftmailer/zipball/fd917fbe63b7ea796c52902143b83b98e65bfb73", - "reference": "fd917fbe63b7ea796c52902143b83b98e65bfb73", + "url": "https://api.github.com/repos/yiisoft/yii2-swiftmailer/zipball/09659a55959f9e64b8178d842b64a9ffae42b994", + "reference": "09659a55959f9e64b8178d842b64a9ffae42b994", "shasum": "" }, "require": { "swiftmailer/swiftmailer": "~6.0", - "yiisoft/yii2": "~2.0.4" + "yiisoft/yii2": ">=2.0.4" }, "type": "yii2-extension", "extra": { @@ -2487,7 +2324,7 @@ "swiftmailer", "yii2" ], - "time": "2018-04-24T23:17:42+00:00" + "time": "2018-09-23T22:00:47+00:00" } ], "packages-dev": [ @@ -2552,16 +2389,16 @@ }, { "name": "bower-asset/bootstrap", - "version": "v3.3.7", + "version": "v3.4.1", "source": { "type": "git", "url": "https://github.com/twbs/bootstrap.git", - "reference": "0b9c4a4007c44201dce9a6cc1a38407005c26c86" + "reference": "68b0d231a13201eb14acd3dc84e51543d16e5f7e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twbs/bootstrap/zipball/0b9c4a4007c44201dce9a6cc1a38407005c26c86", - "reference": "0b9c4a4007c44201dce9a6cc1a38407005c26c86", + "url": "https://api.github.com/repos/twbs/bootstrap/zipball/68b0d231a13201eb14acd3dc84e51543d16e5f7e", + "reference": "68b0d231a13201eb14acd3dc84e51543d16e5f7e", "shasum": null }, "require": { @@ -2574,16 +2411,16 @@ }, { "name": "codeception/codeception", - "version": "2.5.3", + "version": "2.5.4", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "19f0fe845c0af5af2a6c094dc0df3a178a3fd5b0" + "reference": "a2ecfe2f3ad36cc29904d2d566b0d7280854e6c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/19f0fe845c0af5af2a6c094dc0df3a178a3fd5b0", - "reference": "19f0fe845c0af5af2a6c094dc0df3a178a3fd5b0", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/a2ecfe2f3ad36cc29904d2d566b0d7280854e6c9", + "reference": "a2ecfe2f3ad36cc29904d2d566b0d7280854e6c9", "shasum": "" }, "require": { @@ -2662,30 +2499,27 @@ "functional testing", "unit testing" ], - "time": "2019-02-02T15:39:58+00:00" + "time": "2019-02-20T20:45:25+00:00" }, { "name": "codeception/phpunit-wrapper", - "version": "6.5.1", + "version": "7.6.1", "source": { "type": "git", "url": "https://github.com/Codeception/phpunit-wrapper.git", - "reference": "d78f9eb9c4300a5924cc27dee03e8c1a96fcf5f3" + "reference": "ed4b12beb167dc2ecea293b4f6df6c20ce8d280f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/d78f9eb9c4300a5924cc27dee03e8c1a96fcf5f3", - "reference": "d78f9eb9c4300a5924cc27dee03e8c1a96fcf5f3", + "url": "https://api.github.com/repos/Codeception/phpunit-wrapper/zipball/ed4b12beb167dc2ecea293b4f6df6c20ce8d280f", + "reference": "ed4b12beb167dc2ecea293b4f6df6c20ce8d280f", "shasum": "" }, "require": { - "phpunit/php-code-coverage": ">=4.0.4 <6.0", - "phpunit/phpunit": ">=6.5.13 <7.0", - "sebastian/comparator": ">=1.2.4 <3.0", - "sebastian/diff": ">=1.4 <4.0" - }, - "replace": { - "codeception/phpunit-wrapper": "*" + "phpunit/php-code-coverage": "^6.0", + "phpunit/phpunit": ">=7.1 <7.6", + "sebastian/comparator": "^3.0", + "sebastian/diff": "^3.0" }, "require-dev": { "codeception/specify": "*", @@ -2708,26 +2542,26 @@ } ], "description": "PHPUnit classes used by Codeception", - "time": "2019-01-13T10:34:55+00:00" + "time": "2019-01-13T10:34:39+00:00" }, { "name": "codeception/specify", - "version": "1.0", + "version": "1.1", "source": { "type": "git", "url": "https://github.com/Codeception/Specify.git", - "reference": "1b1fe23f887aac647d0f7f5be3867b240690449d" + "reference": "504ac7a882e6f7226b0cff44c72a6c0bbd0bad95" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Specify/zipball/1b1fe23f887aac647d0f7f5be3867b240690449d", - "reference": "1b1fe23f887aac647d0f7f5be3867b240690449d", + "url": "https://api.github.com/repos/Codeception/Specify/zipball/504ac7a882e6f7226b0cff44c72a6c0bbd0bad95", + "reference": "504ac7a882e6f7226b0cff44c72a6c0bbd0bad95", "shasum": "" }, "require": { "myclabs/deep-copy": "~1.1", - "php": ">=7.0.0", - "phpunit/phpunit": "~6.0" + "php": ">=7.1.0", + "phpunit/phpunit": "^7.0" }, "type": "library", "autoload": { @@ -2746,7 +2580,7 @@ } ], "description": "BDD code blocks for PHPUnit and Codeception", - "time": "2017-11-20T23:40:31+00:00" + "time": "2018-03-12T23:55:10+00:00" }, { "name": "codeception/stub", @@ -2882,16 +2716,16 @@ }, { "name": "composer/xdebug-handler", - "version": "1.1.0", + "version": "1.3.2", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08" + "reference": "d17708133b6c276d6e42ef887a877866b909d892" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/c919dc6c62e221fc6406f861ea13433c0aa24f08", - "reference": "c919dc6c62e221fc6406f861ea13433c0aa24f08", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/d17708133b6c276d6e42ef887a877866b909d892", + "reference": "d17708133b6c276d6e42ef887a877866b909d892", "shasum": "" }, "require": { @@ -2922,7 +2756,7 @@ "Xdebug", "performance" ], - "time": "2018-04-11T15:42:36+00:00" + "time": "2019-01-28T20:25:53+00:00" }, { "name": "doctrine/instantiator", @@ -3221,16 +3055,16 @@ }, { "name": "fzaninotto/faker", - "version": "v1.7.1", + "version": "v1.8.0", "source": { "type": "git", "url": "https://github.com/fzaninotto/Faker.git", - "reference": "d3ed4cc37051c1ca52d22d76b437d14809fc7e0d" + "reference": "f72816b43e74063c8b10357394b6bba8cb1c10de" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/d3ed4cc37051c1ca52d22d76b437d14809fc7e0d", - "reference": "d3ed4cc37051c1ca52d22d76b437d14809fc7e0d", + "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/f72816b43e74063c8b10357394b6bba8cb1c10de", + "reference": "f72816b43e74063c8b10357394b6bba8cb1c10de", "shasum": "" }, "require": { @@ -3238,7 +3072,7 @@ }, "require-dev": { "ext-intl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", + "phpunit/phpunit": "^4.8.35 || ^5.7", "squizlabs/php_codesniffer": "^1.5" }, "type": "library", @@ -3267,7 +3101,7 @@ "faker", "fixtures" ], - "time": "2017-08-15T16:48:10+00:00" + "time": "2018-07-12T10:23:15+00:00" }, { "name": "hamcrest/hamcrest-php", @@ -3319,16 +3153,16 @@ }, { "name": "mockery/mockery", - "version": "1.0", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/mockery/mockery.git", - "reference": "1bac8c362b12f522fdd1f1fa3556284c91affa38" + "reference": "0eb0b48c3f07b3b89f5169ce005b7d05b18cf1d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mockery/mockery/zipball/1bac8c362b12f522fdd1f1fa3556284c91affa38", - "reference": "1bac8c362b12f522fdd1f1fa3556284c91affa38", + "url": "https://api.github.com/repos/mockery/mockery/zipball/0eb0b48c3f07b3b89f5169ce005b7d05b18cf1d2", + "reference": "0eb0b48c3f07b3b89f5169ce005b7d05b18cf1d2", "shasum": "" }, "require": { @@ -3337,7 +3171,7 @@ "php": ">=5.6.0" }, "require-dev": { - "phpunit/phpunit": "~5.7|~6.1" + "phpunit/phpunit": "~5.7.10|~6.5|~7.0|~8.0" }, "type": "library", "extra": { @@ -3366,8 +3200,8 @@ "homepage": "http://davedevelopment.co.uk" } ], - "description": "Mockery is a simple yet flexible PHP mock object framework for use in unit testing with PHPUnit, PHPSpec or any other testing framework. Its core goal is to offer a test double framework with a succinct API capable of clearly defining all possible object operations and interactions using a human readable Domain Specific Language (DSL). Designed as a drop in alternative to PHPUnit's phpunit-mock-objects library, Mockery is easy to integrate with PHPUnit and can operate alongside phpunit-mock-objects without the World ending.", - "homepage": "http://github.com/mockery/mockery", + "description": "Mockery is a simple yet flexible PHP mock object framework", + "homepage": "https://github.com/mockery/mockery", "keywords": [ "BDD", "TDD", @@ -3380,7 +3214,7 @@ "test double", "testing" ], - "time": "2017-10-06T16:20:43+00:00" + "time": "2019-02-13T09:37:52+00:00" }, { "name": "myclabs/deep-copy", @@ -3432,22 +3266,22 @@ }, { "name": "phar-io/manifest", - "version": "1.0.1", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0" + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/2df402786ab5368a0169091f61a7c1e0eb6852d0", - "reference": "2df402786ab5368a0169091f61a7c1e0eb6852d0", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", + "reference": "7761fcacf03b4d4f16e7ccb606d4879ca431fcf4", "shasum": "" }, "require": { "ext-dom": "*", "ext-phar": "*", - "phar-io/version": "^1.0.1", + "phar-io/version": "^2.0", "php": "^5.6 || ^7.0" }, "type": "library", @@ -3483,20 +3317,20 @@ } ], "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", - "time": "2017-03-05T18:14:27+00:00" + "time": "2018-07-08T19:23:20+00:00" }, { "name": "phar-io/version", - "version": "1.0.1", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/phar-io/version.git", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df" + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/version/zipball/a70c0ced4be299a63d32fa96d9281d03e94041df", - "reference": "a70c0ced4be299a63d32fa96d9281d03e94041df", + "url": "https://api.github.com/repos/phar-io/version/zipball/45a2ec53a73c70ce41d55cedef9063630abaf1b6", + "reference": "45a2ec53a73c70ce41d55cedef9063630abaf1b6", "shasum": "" }, "require": { @@ -3530,7 +3364,7 @@ } ], "description": "Library for handling version information and constraints", - "time": "2017-03-05T17:38:23+00:00" + "time": "2018-07-08T19:19:57+00:00" }, { "name": "php-cs-fixer/diff", @@ -3585,30 +3419,29 @@ }, { "name": "php-mock/php-mock", - "version": "1.0.1", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/php-mock/php-mock.git", - "reference": "bfa2d17d64dbf129073a7ba2051a96ce52749570" + "reference": "22d297231118e6fd5b9db087fbe1ef866c2b95d2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-mock/php-mock/zipball/bfa2d17d64dbf129073a7ba2051a96ce52749570", - "reference": "bfa2d17d64dbf129073a7ba2051a96ce52749570", + "url": "https://api.github.com/repos/php-mock/php-mock/zipball/22d297231118e6fd5b9db087fbe1ef866c2b95d2", + "reference": "22d297231118e6fd5b9db087fbe1ef866c2b95d2", "shasum": "" }, "require": { - "php": ">=5.5", + "php": ">=5.6", "phpunit/php-text-template": "^1" }, "replace": { "malkusch/php-mock": "*" }, "require-dev": { - "phpunit/phpunit": "^4|^5" + "phpunit/phpunit": "^5.7" }, "suggest": { - "php-mock/php-mock-mockery": "Allows using PHPMockery for Mockery integration", "php-mock/php-mock-phpunit": "Allows integration into PHPUnit testcase with the trait PHPMock." }, "type": "library", @@ -3616,7 +3449,7 @@ "psr-4": { "phpmock\\": [ "classes/", - "tests/unit/" + "tests/" ] } }, @@ -3643,25 +3476,25 @@ "test", "test double" ], - "time": "2015-11-11T22:37:09+00:00" + "time": "2017-02-17T20:52:52+00:00" }, { "name": "php-mock/php-mock-integration", - "version": "1.0.0", + "version": "2.0.0", "source": { "type": "git", "url": "https://github.com/php-mock/php-mock-integration.git", - "reference": "e83fb65dd20cd3cf250d554cbd4682b96b684f4b" + "reference": "5a0d7d7755f823bc2a230cfa45058b40f9013bc4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-mock/php-mock-integration/zipball/e83fb65dd20cd3cf250d554cbd4682b96b684f4b", - "reference": "e83fb65dd20cd3cf250d554cbd4682b96b684f4b", + "url": "https://api.github.com/repos/php-mock/php-mock-integration/zipball/5a0d7d7755f823bc2a230cfa45058b40f9013bc4", + "reference": "5a0d7d7755f823bc2a230cfa45058b40f9013bc4", "shasum": "" }, "require": { - "php": ">=5.5", - "php-mock/php-mock": "^1", + "php": ">=5.6", + "php-mock/php-mock": "^2", "phpunit/php-text-template": "^1" }, "require-dev": { @@ -3696,26 +3529,26 @@ "test", "test double" ], - "time": "2015-10-26T21:21:42+00:00" + "time": "2017-02-17T21:31:34+00:00" }, { "name": "php-mock/php-mock-mockery", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/php-mock/php-mock-mockery.git", - "reference": "f3d67a36558c6d1fb912ed8ba786fffaf94e0755" + "reference": "d6d3df9d9232f1623f1ca3cfdaacd53415593825" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-mock/php-mock-mockery/zipball/f3d67a36558c6d1fb912ed8ba786fffaf94e0755", - "reference": "f3d67a36558c6d1fb912ed8ba786fffaf94e0755", + "url": "https://api.github.com/repos/php-mock/php-mock-mockery/zipball/d6d3df9d9232f1623f1ca3cfdaacd53415593825", + "reference": "d6d3df9d9232f1623f1ca3cfdaacd53415593825", "shasum": "" }, "require": { "mockery/mockery": "^1", "php": ">=5.6", - "php-mock/php-mock-integration": "^1" + "php-mock/php-mock-integration": "^2" }, "require-dev": { "phpunit/phpunit": "^4|^5" @@ -3750,7 +3583,7 @@ "test", "test double" ], - "time": "2017-10-13T09:34:01+00:00" + "time": "2018-03-27T07:00:25+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -3969,40 +3802,40 @@ }, { "name": "phpunit/php-code-coverage", - "version": "5.3.2", + "version": "6.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac" + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/c89677919c5dd6d3b3852f230a663118762218ac", - "reference": "c89677919c5dd6d3b3852f230a663118762218ac", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", + "reference": "807e6013b00af69b6c5d9ceb4282d0393dbb9d8d", "shasum": "" }, "require": { "ext-dom": "*", "ext-xmlwriter": "*", - "php": "^7.0", - "phpunit/php-file-iterator": "^1.4.2", + "php": "^7.1", + "phpunit/php-file-iterator": "^2.0", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-token-stream": "^2.0.1", + "phpunit/php-token-stream": "^3.0", "sebastian/code-unit-reverse-lookup": "^1.0.1", - "sebastian/environment": "^3.0", + "sebastian/environment": "^3.1 || ^4.0", "sebastian/version": "^2.0.1", "theseer/tokenizer": "^1.1" }, "require-dev": { - "phpunit/phpunit": "^6.0" + "phpunit/phpunit": "^7.0" }, "suggest": { - "ext-xdebug": "^2.5.5" + "ext-xdebug": "^2.6.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3.x-dev" + "dev-master": "6.1-dev" } }, "autoload": { @@ -4028,29 +3861,32 @@ "testing", "xunit" ], - "time": "2018-04-06T15:36:58+00:00" + "time": "2018-10-31T16:06:48+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "1.4.5", + "version": "2.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" + "reference": "050bedf145a257b1ff02746c31894800e5122946" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/050bedf145a257b1ff02746c31894800e5122946", + "reference": "050bedf145a257b1ff02746c31894800e5122946", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^7.1" + }, + "require-dev": { + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.4.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -4065,7 +3901,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -4075,7 +3911,7 @@ "filesystem", "iterator" ], - "time": "2017-11-27T13:52:08+00:00" + "time": "2018-09-13T20:33:42+00:00" }, { "name": "phpunit/php-text-template", @@ -4120,28 +3956,28 @@ }, { "name": "phpunit/php-timer", - "version": "1.0.9", + "version": "2.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" + "reference": "8b389aebe1b8b0578430bda0c7c95a829608e059" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/8b389aebe1b8b0578430bda0c7c95a829608e059", + "reference": "8b389aebe1b8b0578430bda0c7c95a829608e059", "shasum": "" }, "require": { - "php": "^5.3.3 || ^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "2.1-dev" } }, "autoload": { @@ -4156,7 +3992,7 @@ "authors": [ { "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", + "email": "sebastian@phpunit.de", "role": "lead" } ], @@ -4165,33 +4001,33 @@ "keywords": [ "timer" ], - "time": "2017-02-26T11:10:40+00:00" + "time": "2019-02-20T10:12:59+00:00" }, { "name": "phpunit/php-token-stream", - "version": "2.0.2", + "version": "3.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "791198a2c6254db10131eecfe8c06670700904db" + "reference": "c99e3be9d3e85f60646f152f9002d46ed7770d18" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/791198a2c6254db10131eecfe8c06670700904db", - "reference": "791198a2c6254db10131eecfe8c06670700904db", + "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/c99e3be9d3e85f60646f152f9002d46ed7770d18", + "reference": "c99e3be9d3e85f60646f152f9002d46ed7770d18", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.2.4" + "phpunit/phpunit": "^7.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -4214,57 +4050,57 @@ "keywords": [ "tokenizer" ], - "time": "2017-11-27T05:48:46+00:00" + "time": "2018-10-30T05:52:18+00:00" }, { "name": "phpunit/phpunit", - "version": "6.5.14", + "version": "7.5.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7" + "reference": "09c85e14994df92e5ff1f5ec0b481bdb7d3d3df9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/bac23fe7ff13dbdb461481f706f0e9fe746334b7", - "reference": "bac23fe7ff13dbdb461481f706f0e9fe746334b7", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/09c85e14994df92e5ff1f5ec0b481bdb7d3d3df9", + "reference": "09c85e14994df92e5ff1f5ec0b481bdb7d3d3df9", "shasum": "" }, "require": { + "doctrine/instantiator": "^1.1", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", - "myclabs/deep-copy": "^1.6.1", - "phar-io/manifest": "^1.0.1", - "phar-io/version": "^1.0", - "php": "^7.0", + "myclabs/deep-copy": "^1.7", + "phar-io/manifest": "^1.0.2", + "phar-io/version": "^2.0", + "php": "^7.1", "phpspec/prophecy": "^1.7", - "phpunit/php-code-coverage": "^5.3", - "phpunit/php-file-iterator": "^1.4.3", + "phpunit/php-code-coverage": "^6.0.7", + "phpunit/php-file-iterator": "^2.0.1", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^1.0.9", - "phpunit/phpunit-mock-objects": "^5.0.9", - "sebastian/comparator": "^2.1", - "sebastian/diff": "^2.0", - "sebastian/environment": "^3.1", + "phpunit/php-timer": "^2.0", + "sebastian/comparator": "^3.0", + "sebastian/diff": "^3.0", + "sebastian/environment": "^4.0", "sebastian/exporter": "^3.1", "sebastian/global-state": "^2.0", "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^1.0", + "sebastian/resource-operations": "^2.0", "sebastian/version": "^2.0.1" }, "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2", - "phpunit/dbunit": "<3.0" + "phpunit/phpunit-mock-objects": "*" }, "require-dev": { "ext-pdo": "*" }, "suggest": { + "ext-soap": "*", "ext-xdebug": "*", - "phpunit/php-invoker": "^1.1" + "phpunit/php-invoker": "^2.0" }, "bin": [ "phpunit" @@ -4272,7 +4108,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "6.5.x-dev" + "dev-master": "7.5-dev" } }, "autoload": { @@ -4298,66 +4134,7 @@ "testing", "xunit" ], - "time": "2019-02-01T05:22:47+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "5.0.10", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/cd1cf05c553ecfec36b170070573e540b67d3f1f", - "reference": "cd1cf05c553ecfec36b170070573e540b67d3f1f", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.5", - "php": "^7.0", - "phpunit/php-text-template": "^1.2.1", - "sebastian/exporter": "^3.1" - }, - "conflict": { - "phpunit/phpunit": "<6.0" - }, - "require-dev": { - "phpunit/phpunit": "^6.5.11" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "time": "2018-08-09T05:50:03+00:00" + "time": "2019-02-18T09:24:50+00:00" }, { "name": "predis/predis", @@ -4411,16 +4188,16 @@ }, { "name": "psr/log", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d" + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", - "reference": "4ebe3a8bf773a19edfe0a84b6585ba3d401b724d", + "url": "https://api.github.com/repos/php-fig/log/zipball/6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", + "reference": "6c001f1daafa3a3ac1d8ff69ee4db8e799a654dd", "shasum": "" }, "require": { @@ -4454,7 +4231,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2018-11-20T15:27:04+00:00" }, { "name": "roave/security-advisories", @@ -4462,21 +4239,24 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "0253937ef2720f45fbe421e3ba486587b3080c35" + "reference": "614a9db1df6be4349544311096f8d48ca067ccbb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/0253937ef2720f45fbe421e3ba486587b3080c35", - "reference": "0253937ef2720f45fbe421e3ba486587b3080c35", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/614a9db1df6be4349544311096f8d48ca067ccbb", + "reference": "614a9db1df6be4349544311096f8d48ca067ccbb", "shasum": "" }, "conflict": { "3f/pygmentize": "<1.2", "adodb/adodb-php": "<5.20.12", + "alterphp/easyadmin-extension-bundle": ">=1.2,<1.2.11|>=1.3,<1.3.1", "amphp/artax": "<1.0.6|>=2,<2.0.6", "amphp/http": "<1.0.1", + "api-platform/core": ">=2.2,<2.2.10|>=2.3,<2.3.6", "asymmetricrypt/asymmetricrypt": ">=0,<9.9.99", "aws/aws-sdk-php": ">=3,<3.2.1", + "brightlocal/phpwhois": "<=4.2.5", "bugsnag/bugsnag-laravel": ">=2,<2.0.2", "cakephp/cakephp": ">=1.3,<1.3.18|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=2.7,<2.7.6|>=3,<3.0.15|>=3.1,<3.1.4|>=3.4,<3.4.14|>=3.5,<3.5.17|>=3.6,<3.6.4", "cart2quote/module-quotation": ">=4.1.6,<=4.4.5|>=5,<5.4.4", @@ -4488,6 +4268,7 @@ "contao/core-bundle": ">=4,<4.4.18|>=4.5,<4.5.8", "contao/listing-bundle": ">=4,<4.4.8", "contao/newsletter-bundle": ">=4,<4.1", + "david-garcia/phpwhois": "<=4.3.1", "doctrine/annotations": ">=1,<1.2.7", "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", @@ -4498,11 +4279,99 @@ "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", "dompdf/dompdf": ">=0.6,<0.6.2", - "drupal/core": ">=7,<7.59|>=8,<8.4.8|>=8.5,<8.5.3", - "drupal/drupal": ">=7,<7.59|>=8,<8.4.8|>=8.5,<8.5.3", + "drupal/acquia_connector": ">=1,<1.16", + "drupal/autologout": ">=4,<4.5", + "drupal/backup_migrate": ">=3,<3.4", + "drupal/bealestreet": ">=1,<1.2", + "drupal/bible": ">=1,<1.7", + "drupal/bing_autosuggest_api": ">=1,<1.1", + "drupal/bootstrap": ">=3,<3.14", + "drupal/brilliant_gallery": ">=1,<1.10", + "drupal/ckeditor_uploadimage": ">=1,<1.5", + "drupal/cleantalk": ">=2,<2.7", + "drupal/cloud": ">=1,<1.7", + "drupal/commerce": ">=2,<2.9", + "drupal/commerce_custom_order_status": ">=1,<1.1", + "drupal/commerce_klarna_checkout": ">=1,<1.5", + "drupal/config_perms": ">=1,<1.1|>=2,<2.2", + "drupal/config_update": ">=1,<1.5", + "drupal/core": ">=7,<7.62|>=8,<8.5.11|>=8.6,<8.6.10", + "drupal/datereminder": ">=1,<1.15", + "drupal/decoupled_router": ">=1,<1.2", + "drupal/domain_integration": ">=1,<1.2", + "drupal/drupal": ">=7,<7.62|>=8,<8.5.11|>=8.6,<8.6.10", + "drupal/entity": ">=1,<1.9", + "drupal/entity_ref_tab_formatter": ">=1,<1.3", + "drupal/entityqueue_taxonomy": ">=1,<1.1", + "drupal/esign": ">=1,<1.10", + "drupal/eu_cookie_compliance": ">=1,<1.1", + "drupal/exif": ">=1,<1.1", + "drupal/feedback_collect": ">=1,<1.6", + "drupal/filefield_paths": ">=1,<1.1", + "drupal/filefield_sources": ">=1,<1.11", + "drupal/focal_point": ">=1,<1.2", + "drupal/fontawesome": ">=2,<2.12", + "drupal/fraction": ">=1,<1.2", + "drupal/gathercontent": ">=3,<3.5", + "drupal/genpass": ">=1,<1.1", + "drupal/hosting_https": ">=3,<3.170", + "drupal/jsonapi": ">=1,<1.16", + "drupal/lightbox2": ">=2,<2.11", + "drupal/link": ">=1,<1.6", + "drupal/litejazz": ">=2,<2.3", + "drupal/mailhandler": ">=2,<2.11", + "drupal/mass_pwreset": ">=1,<1.1", + "drupal/me": ">=1,<1.3", + "drupal/media": ">=2,<2.19", + "drupal/menu_export": ">=1,<1.2", + "drupal/metatag": ">=1,<1.8", + "drupal/miniorange_oauth_client": ">=1,<1.21", + "drupal/moneysuite": ">=10,<10.4", + "drupal/mosaik": ">=1,<1.2", + "drupal/netforum_authentication": ">=1,<1.1", + "drupal/newsflash": ">=2,<2.6", + "drupal/node_feedback": ">=1,<1.3", + "drupal/node_view_permissions": ">=1,<1.1", + "drupal/nucleus": ">=1,<1.6", + "drupal/nvp": ">=1,<1.1", + "drupal/panels_breadcrumbs": ">=2,<2.4", + "drupal/panopoly_core": ">=1,<1.49", + "drupal/paragraphs": ">=1,<1.6", + "drupal/password_policy": ">=1,<1.16", + "drupal/permissions_by_term": ">=1,<1.35", + "drupal/phonefield": ">=1,<1.1", + "drupal/phpconfig": ">=1,<1.1", + "drupal/preview_link": ">=1,<1.1", + "drupal/print": ">=2,<2.1", + "drupal/provision": ">=3,<3.170", + "drupal/pubdlcnt": ">=1,<1.3", + "drupal/renderkit": ">=1,<1.6", + "drupal/responsive_menus": ">=1,<1.7", + "drupal/restws": ">=2,<2.8", + "drupal/sagepay_payment": ">=1,<1.5", + "drupal/salesforce": ">=3,<3.1", + "drupal/search_api_solr": ">=1,<1.14", + "drupal/search_autocomplete": ">=4,<4.8", + "drupal/services_sso_client": ">=1,<1.6", + "drupal/stacks": ">=1,<1.1", + "drupal/tapestry": ">=2,<2.2", + "drupal/term_reference_tree": ">=1,<1.11", + "drupal/tfa_basic": ">=1,<1.1", + "drupal/tft": ">=1,<1.1", + "drupal/tmgmt": ">=1,<1.7", + "drupal/uuid": ">=1,<1.1", + "drupal/video": ">=1,<1.4", + "drupal/workbench_moderation": ">=1,<1.4", + "drupal/yandex_metrics": ">=3,<3.1", + "drupal/zircon": ">=1,<1.2", "erusev/parsedown": "<1.7", - "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.3|>=5.4,<5.4.11.3|>=2017.8,<2017.8.1.1|>=2017.12,<2017.12.2.1", + "ezsystems/ezpublish-kernel": ">=5.3,<5.3.12.1|>=5.4,<5.4.13.1|>=6,<6.7.9.1|>=6.8,<6.13.5.1|>=7,<7.2.4.1|>=7.3,<7.3.2.1", + "ezsystems/ezpublish-legacy": ">=5.3,<5.3.12.6|>=5.4,<5.4.12.3|>=2011,<2017.12.4.3|>=2018.6,<2018.6.1.4|>=2018.9,<2018.9.1.3", + "ezsystems/repository-forms": ">=2.3,<2.3.2.1", + "ezyang/htmlpurifier": "<4.1.1", "firebase/php-jwt": "<2", + "fooman/tcpdf": "<6.2.22", + "fossar/tcpdf-parser": "<6.2.22", "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", "fuel/core": "<1.8.1", @@ -4510,71 +4379,98 @@ "gregwar/rst": "<1.0.3", "guzzlehttp/guzzle": ">=6,<6.2.1|>=4.0.0-rc2,<4.2.4|>=5,<5.3.1", "illuminate/auth": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.10", + "illuminate/cookie": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", "illuminate/encryption": ">=4,<=4.0.11|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", + "ivankristianto/phpwhois": "<=4.3", + "james-heinrich/getid3": "<1.9.9", "joomla/session": "<1.3.1", + "jsmitty12/phpwhois": "<5.1", + "kazist/phpwhois": "<=4.2.6", "kreait/firebase-php": ">=3.2,<3.8.1", - "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.40|>=5.6,<5.6.15", + "la-haute-societe/tcpdf": "<6.2.22", + "laravel/framework": ">=4,<4.0.99|>=4.1,<=4.1.31|>=4.2,<=4.2.22|>=5,<=5.0.35|>=5.1,<=5.1.46|>=5.2,<=5.2.45|>=5.3,<=5.3.31|>=5.4,<=5.4.36|>=5.5,<5.5.42|>=5.6,<5.6.30", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", - "magento/magento1ce": ">=1.5.0.1,<1.9.3.2", - "magento/magento1ee": ">=1.9,<1.14.3.2", - "magento/product-community-edition": ">=2,<2.2.5", + "league/commonmark": ">=0.15.6,<0.18.1", + "magento/magento1ce": "<1.9.4", + "magento/magento1ee": ">=1.9,<1.14.4", + "magento/product-community-edition": ">=2,<2.2.7", "monolog/monolog": ">=1.8,<1.12", "namshi/jose": "<2.2", "onelogin/php-saml": "<2.10.4", + "openid/php-openid": "<2.3", "oro/crm": ">=1.7,<1.7.4", "oro/platform": ">=1.7,<1.7.4", "padraic/humbug_get_contents": "<1.1.2", "pagarme/pagarme-php": ">=0,<3", "paragonie/random_compat": "<2", "paypal/merchant-sdk-php": "<3.12", - "phpmailer/phpmailer": ">=5,<5.2.24", + "pear/archive_tar": "<1.4.4", + "phpmailer/phpmailer": ">=5,<5.2.27|>=6,<6.0.6", + "phpoffice/phpexcel": "<=1.8.1", + "phpoffice/phpspreadsheet": "<=1.5", "phpunit/phpunit": ">=4.8.19,<4.8.28|>=5.0.10,<5.6.3", + "phpwhois/phpwhois": "<=4.2.5", "phpxmlrpc/extras": "<0.6.1", "propel/propel": ">=2.0.0-alpha1,<=2.0.0-alpha7", "propel/propel1": ">=1,<=1.7.1", "pusher/pusher-php-server": "<2.2.1", + "robrichards/xmlseclibs": ">=1,<3.0.2", "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", "sensiolabs/connect": "<4.2.3", + "serluck/phpwhois": "<=4.2.6", "shopware/shopware": "<5.3.7", "silverstripe/cms": ">=3,<=3.0.11|>=3.1,<3.1.11", "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": ">=3,<3.3", + "silverstripe/framework": ">=3,<3.6.7|>=3.7,<3.7.3|>=4,<4.0.7|>=4.1,<4.1.5|>=4.2,<4.2.4|>=4.3,<4.3.1", "silverstripe/userforms": "<3", + "simple-updates/phpwhois": "<=1", "simplesamlphp/saml2": "<1.10.6|>=2,<2.3.8|>=3,<3.1.4", - "simplesamlphp/simplesamlphp": "<1.15.2", + "simplesamlphp/simplesamlphp": "<1.16.3", "simplesamlphp/simplesamlphp-module-infocard": "<1.0.1", "slim/slim": "<2.6", + "smarty/smarty": "<3.1.33", "socalnick/scn-social-auth": "<1.15.2", + "spoonity/tcpdf": "<6.2.22", "squizlabs/php_codesniffer": ">=1,<2.8.1|>=3,<3.0.1", "stormpath/sdk": ">=0,<9.9.99", "swiftmailer/swiftmailer": ">=4,<5.4.5", + "sylius/admin-bundle": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", + "sylius/sylius": ">=1,<1.0.17|>=1.1,<1.1.9|>=1.2,<1.2.2", "symfony/dependency-injection": ">=2,<2.0.17", - "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2", - "symfony/http-foundation": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/http-foundation": ">=2,<2.7.49|>=2.8,<2.8.44|>=3,<3.3.18|>=3.4,<3.4.14|>=4,<4.0.14|>=4.1,<4.1.3", "symfony/http-kernel": ">=2,<2.3.29|>=2.4,<2.5.12|>=2.6,<2.6.8", "symfony/intl": ">=2.7,<2.7.38|>=2.8,<2.8.31|>=3,<3.2.14|>=3.3,<3.3.13", + "symfony/polyfill": ">=1,<1.10", + "symfony/polyfill-php55": ">=1,<1.10", "symfony/routing": ">=2,<2.0.19", - "symfony/security": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/security": ">=2,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.19|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", "symfony/security-bundle": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", "symfony/security-core": ">=2.4,<2.6.13|>=2.7,<2.7.9|>=2.7.30,<2.7.32|>=2.8,<2.8.37|>=3,<3.3.17|>=3.4,<3.4.7|>=4,<4.0.7", "symfony/security-csrf": ">=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", "symfony/security-guard": ">=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", - "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/security-http": ">=2.3,<2.3.41|>=2.4,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.7.48|>=2.8,<2.8.41|>=3,<3.3.17|>=3.4,<3.4.11|>=4,<4.0.11", + "symfony/symfony": ">=2,<2.7.50|>=2.8,<2.8.49|>=3,<3.4.20|>=4,<4.0.15|>=4.1,<4.1.9|>=4.2,<4.2.1", "symfony/translation": ">=2,<2.0.17", "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", + "tecnickcom/tcpdf": "<6.2.22", "thelia/backoffice-default-template": ">=2.1,<2.1.2", - "thelia/thelia": ">=2.1.0-beta1,<2.1.3|>=2.1,<2.1.2", + "thelia/thelia": ">=2.1,<2.1.2|>=2.1.0-beta1,<2.1.3", + "theonedemon/phpwhois": "<=4.2.5", "titon/framework": ">=0,<9.9.99", + "truckersmp/phpwhois": "<=4.3.1", "twig/twig": "<1.20", - "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.22|>=8,<8.7.5", + "typo3/cms": ">=6.2,<6.2.30|>=7,<7.6.32|>=8,<8.7.23|>=9,<9.5.4", + "typo3/cms-core": ">=8,<8.7.23|>=9,<9.5.4", "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.16|>=3,<3.0.10|>=3.1,<3.1.7|>=3.2,<3.2.7|>=3.3,<3.3.5", "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", + "ua-parser/uap-php": "<3.8", + "wallabag/tcpdf": "<6.2.22", "willdurand/js-translation-bundle": "<2.1.1", "yiisoft/yii": ">=1.1.14,<1.1.15", "yiisoft/yii2": "<2.0.15", @@ -4588,9 +4484,10 @@ "zendframework/zend-captcha": ">=2,<2.4.9|>=2.5,<2.5.2", "zendframework/zend-crypt": ">=2,<2.4.9|>=2.5,<2.5.2", "zendframework/zend-db": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.10|>=2.3,<2.3.5", - "zendframework/zend-diactoros": ">=1,<1.0.4", + "zendframework/zend-diactoros": ">=1,<1.8.4", + "zendframework/zend-feed": ">=1,<2.10.3", "zendframework/zend-form": ">=2,<2.2.7|>=2.3,<2.3.1", - "zendframework/zend-http": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.3,<2.3.8|>=2.4,<2.4.1", + "zendframework/zend-http": ">=1,<2.8.1", "zendframework/zend-json": ">=2.1,<2.1.6|>=2.2,<2.2.6", "zendframework/zend-ldap": ">=2,<2.0.99|>=2.1,<2.1.99|>=2.2,<2.2.8|>=2.3,<2.3.3", "zendframework/zend-mail": ">=2,<2.4.11|>=2.5,<2.7.2", @@ -4599,7 +4496,7 @@ "zendframework/zend-validator": ">=2.3,<2.3.6", "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1", "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6", - "zendframework/zendframework": ">=2,<2.4.11|>=2.5,<2.5.1", + "zendframework/zendframework": "<2.5.1", "zendframework/zendframework1": "<1.12.20", "zendframework/zendopenid": ">=2,<2.0.2", "zendframework/zendxml": ">=1,<1.0.1", @@ -4621,7 +4518,7 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2018-07-04T05:48:21+00:00" + "time": "2019-02-22T18:40:39+00:00" }, { "name": "sebastian/code-unit-reverse-lookup", @@ -4670,30 +4567,30 @@ }, { "name": "sebastian/comparator", - "version": "2.1.3", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9" + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/34369daee48eafb2651bea869b4b15d75ccc35f9", - "reference": "34369daee48eafb2651bea869b4b15d75ccc35f9", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/5de4fc177adf9bce8df98d8d141a7559d7ccf6da", + "reference": "5de4fc177adf9bce8df98d8d141a7559d7ccf6da", "shasum": "" }, "require": { - "php": "^7.0", - "sebastian/diff": "^2.0 || ^3.0", + "php": "^7.1", + "sebastian/diff": "^3.0", "sebastian/exporter": "^3.1" }, "require-dev": { - "phpunit/phpunit": "^6.4" + "phpunit/phpunit": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.1.x-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -4730,32 +4627,33 @@ "compare", "equality" ], - "time": "2018-02-01T13:46:46+00:00" + "time": "2018-07-12T15:12:46+00:00" }, { "name": "sebastian/diff", - "version": "2.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd" + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", - "reference": "347c1d8b49c5c3ee30c7040ea6fc446790e6bddd", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/720fcc7e9b5cf384ea68d9d930d480907a0c1a29", + "reference": "720fcc7e9b5cf384ea68d9d930d480907a0c1a29", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.2" + "phpunit/phpunit": "^7.5 || ^8.0", + "symfony/process": "^2 || ^3.3 || ^4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "3.0-dev" } }, "autoload": { @@ -4780,34 +4678,40 @@ "description": "Diff implementation", "homepage": "https://github.com/sebastianbergmann/diff", "keywords": [ - "diff" + "diff", + "udiff", + "unidiff", + "unified diff" ], - "time": "2017-08-03T08:09:46+00:00" + "time": "2019-02-04T06:01:07+00:00" }, { "name": "sebastian/environment", - "version": "3.1.0", + "version": "4.1.0", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5" + "reference": "6fda8ce1974b62b14935adc02a9ed38252eca656" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/cd0871b3975fb7fc44d11314fd1ee20925fce4f5", - "reference": "cd0871b3975fb7fc44d11314fd1ee20925fce4f5", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/6fda8ce1974b62b14935adc02a9ed38252eca656", + "reference": "6fda8ce1974b62b14935adc02a9ed38252eca656", "shasum": "" }, "require": { - "php": "^7.0" + "php": "^7.1" }, "require-dev": { - "phpunit/phpunit": "^6.1" + "phpunit/phpunit": "^7.5" + }, + "suggest": { + "ext-posix": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1.x-dev" + "dev-master": "4.1-dev" } }, "autoload": { @@ -4832,7 +4736,7 @@ "environment", "hhvm" ], - "time": "2017-07-01T08:51:00+00:00" + "time": "2019-02-01T05:27:49+00:00" }, { "name": "sebastian/exporter", @@ -5099,25 +5003,25 @@ }, { "name": "sebastian/resource-operations", - "version": "1.0.0", + "version": "2.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/4d7a795d35b889bf80a0cc04e08d77cedfa917a9", + "reference": "4d7a795d35b889bf80a0cc04e08d77cedfa917a9", "shasum": "" }, "require": { - "php": ">=5.6.0" + "php": "^7.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "2.0-dev" } }, "autoload": { @@ -5137,7 +5041,7 @@ ], "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "time": "2015-07-28T20:34:47+00:00" + "time": "2018-10-04T04:07:39+00:00" }, { "name": "sebastian/version", @@ -5555,25 +5459,26 @@ }, { "name": "symfony/filesystem", - "version": "v4.0.8", + "version": "v4.2.3", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "5d2d655b2c72fc4d9bf7e9bf14f72a447b940f21" + "reference": "7c16ebc2629827d4ec915a52ac809768d060a4ee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/5d2d655b2c72fc4d9bf7e9bf14f72a447b940f21", - "reference": "5d2d655b2c72fc4d9bf7e9bf14f72a447b940f21", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/7c16ebc2629827d4ec915a52ac809768d060a4ee", + "reference": "7c16ebc2629827d4ec915a52ac809768d060a4ee", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1.3", + "symfony/polyfill-ctype": "~1.8" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -5600,20 +5505,20 @@ ], "description": "Symfony Filesystem Component", "homepage": "https://symfony.com", - "time": "2018-02-22T10:50:29+00:00" + "time": "2019-01-16T20:35:37+00:00" }, { - "name": "symfony/finder", + "name": "symfony/options-resolver", "version": "v4.2.3", "source": { "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "ef71816cbb264988bb57fe6a73f610888b9aa70c" + "url": "https://github.com/symfony/options-resolver.git", + "reference": "831b272963a8aa5a0613a1a7f013322d8161bbbb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ef71816cbb264988bb57fe6a73f610888b9aa70c", - "reference": "ef71816cbb264988bb57fe6a73f610888b9aa70c", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/831b272963a8aa5a0613a1a7f013322d8161bbbb", + "reference": "831b272963a8aa5a0613a1a7f013322d8161bbbb", "shasum": "" }, "require": { @@ -5625,55 +5530,6 @@ "dev-master": "4.2-dev" } }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2019-01-16T20:35:37+00:00" - }, - { - "name": "symfony/options-resolver", - "version": "v4.0.8", - "source": { - "type": "git", - "url": "https://github.com/symfony/options-resolver.git", - "reference": "371532a2cfe932f7a3766dd4c45364566def1dd0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/options-resolver/zipball/371532a2cfe932f7a3766dd4c45364566def1dd0", - "reference": "371532a2cfe932f7a3766dd4c45364566def1dd0", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, "autoload": { "psr-4": { "Symfony\\Component\\OptionsResolver\\": "" @@ -5703,84 +5559,30 @@ "configuration", "options" ], - "time": "2018-01-18T22:19:33+00:00" - }, - { - "name": "symfony/polyfill-php72", - "version": "v1.7.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "8eca20c8a369e069d4f4c2ac9895144112867422" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/8eca20c8a369e069d4f4c2ac9895144112867422", - "reference": "8eca20c8a369e069d4f4c2ac9895144112867422", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.7-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "time": "2018-01-31T17:43:24+00:00" + "time": "2019-01-16T21:31:25+00:00" }, { "name": "symfony/stopwatch", - "version": "v4.0.8", + "version": "v4.2.3", "source": { "type": "git", "url": "https://github.com/symfony/stopwatch.git", - "reference": "6795ffa2f8eebedac77f045aa62c0c10b2763042" + "reference": "b1a5f646d56a3290230dbc8edf2a0d62cda23f67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/stopwatch/zipball/6795ffa2f8eebedac77f045aa62c0c10b2763042", - "reference": "6795ffa2f8eebedac77f045aa62c0c10b2763042", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/b1a5f646d56a3290230dbc8edf2a0d62cda23f67", + "reference": "b1a5f646d56a3290230dbc8edf2a0d62cda23f67", "shasum": "" }, "require": { - "php": "^7.1.3" + "php": "^7.1.3", + "symfony/contracts": "^1.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "4.0-dev" + "dev-master": "4.2-dev" } }, "autoload": { @@ -5807,7 +5609,7 @@ ], "description": "Symfony Stopwatch Component", "homepage": "https://symfony.com", - "time": "2018-02-19T16:50:22+00:00" + "time": "2019-01-16T20:31:39+00:00" }, { "name": "symfony/yaml", @@ -5910,20 +5712,20 @@ }, { "name": "yiisoft/yii2-bootstrap", - "version": "2.0.8", + "version": "2.0.9", "source": { "type": "git", "url": "https://github.com/yiisoft/yii2-bootstrap.git", - "reference": "3f49c47924bb9fa5363c3fc7b073d954168cf438" + "reference": "4677951dda712dd99d5bf2a127eaee118dfea860" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/3f49c47924bb9fa5363c3fc7b073d954168cf438", - "reference": "3f49c47924bb9fa5363c3fc7b073d954168cf438", + "url": "https://api.github.com/repos/yiisoft/yii2-bootstrap/zipball/4677951dda712dd99d5bf2a127eaee118dfea860", + "reference": "4677951dda712dd99d5bf2a127eaee118dfea860", "shasum": "" }, "require": { - "bower-asset/bootstrap": "3.3.* | 3.2.* | 3.1.*", + "bower-asset/bootstrap": "3.4.* | 3.3.* | 3.2.* | 3.1.*", "yiisoft/yii2": "~2.0.6" }, "type": "yii2-extension", @@ -5966,20 +5768,20 @@ "bootstrap", "yii2" ], - "time": "2018-02-16T10:41:52+00:00" + "time": "2019-01-29T21:39:45+00:00" }, { "name": "yiisoft/yii2-debug", - "version": "2.0.13", + "version": "2.0.14", "source": { "type": "git", "url": "https://github.com/yiisoft/yii2-debug.git", - "reference": "b37f414959c2fafefb332020b42037cd17c1cb7f" + "reference": "dc5a4a8529de1a41dbb037dbabf1f3f93002f21d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/yiisoft/yii2-debug/zipball/b37f414959c2fafefb332020b42037cd17c1cb7f", - "reference": "b37f414959c2fafefb332020b42037cd17c1cb7f", + "url": "https://api.github.com/repos/yiisoft/yii2-debug/zipball/dc5a4a8529de1a41dbb037dbabf1f3f93002f21d", + "reference": "dc5a4a8529de1a41dbb037dbabf1f3f93002f21d", "shasum": "" }, "require": { @@ -5994,7 +5796,7 @@ }, "autoload": { "psr-4": { - "yii\\debug\\": "" + "yii\\debug\\": "src" } }, "notification-url": "https://packagist.org/downloads/", @@ -6013,25 +5815,25 @@ "debugger", "yii2" ], - "time": "2017-12-05T07:36:23+00:00" + "time": "2018-09-23T21:41:04+00:00" }, { "name": "yiisoft/yii2-faker", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/yiisoft/yii2-faker.git", - "reference": "b88ca69ee226a3610b2c26c026c3203d7ac50f6c" + "reference": "3df62b1dcb272a8413f9c6e532c9d73f325ccde1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/yiisoft/yii2-faker/zipball/b88ca69ee226a3610b2c26c026c3203d7ac50f6c", - "reference": "b88ca69ee226a3610b2c26c026c3203d7ac50f6c", + "url": "https://api.github.com/repos/yiisoft/yii2-faker/zipball/3df62b1dcb272a8413f9c6e532c9d73f325ccde1", + "reference": "3df62b1dcb272a8413f9c6e532c9d73f325ccde1", "shasum": "" }, "require": { - "fzaninotto/faker": "*", - "yiisoft/yii2": "*" + "fzaninotto/faker": "~1.4", + "yiisoft/yii2": "~2.0.0" }, "type": "yii2-extension", "extra": { @@ -6060,7 +5862,7 @@ "faker", "yii2" ], - "time": "2015-03-01T06:22:44+00:00" + "time": "2018-02-19T20:27:10+00:00" } ], "aliases": [], @@ -6073,7 +5875,10 @@ "prefer-lowest": false, "platform": { "php": "^7.2", - "ext-json": "*" + "ext-json": "*", + "ext-pdo": "*", + "ext-libxml": "*", + "ext-simplexml": "*" }, "platform-dev": [] } From b20825a051d9d35300da5bbc0fd195091a0d7dd9 Mon Sep 17 00:00:00 2001 From: ErickSkrauch Date: Tue, 26 Feb 2019 02:26:02 +0300 Subject: [PATCH 7/7] Update ely/php-code-style and run updated CS fixer --- .php_cs.dist | 5 +- api/components/User/IdentityInterface.php | 2 +- .../accounts/models/AcceptRulesForm.php | 2 +- .../authserver/models/RefreshTokenForm.php | 4 +- api/tests/_bootstrap.php | 6 +- api/tests/_pages/OauthRoute.php | 6 +- api/tests/_support/FunctionalTester.php | 2 +- .../functional/_steps/SessionServerSteps.php | 4 +- .../sessionserver/HasJoinedCest.php | 2 +- .../sessionserver/HasJoinedLegacyCest.php | 2 +- .../components/ReCaptcha/ValidatorTest.php | 4 +- .../unit/components/User/ComponentTest.php | 48 ++++++++-------- .../User/JwtAuthenticationResultTest.php | 12 ++-- api/tests/unit/models/JwtIdentityTest.php | 4 +- .../authentication/ConfirmEmailFormTest.php | 2 +- .../authentication/ForgotPasswordFormTest.php | 8 +-- .../models/authentication/LoginFormTest.php | 16 +++--- .../authentication/RefreshTokenFormTest.php | 2 +- .../authentication/RegistrationFormTest.php | 8 +-- .../RepeatAccountActivationFormTest.php | 2 +- api/tests/unit/models/base/ApiFormTest.php | 2 +- .../accounts/models/AcceptRulesFormTest.php | 2 +- .../accounts/models/ChangeEmailFormTest.php | 2 +- .../models/ChangeLanguageFormTest.php | 2 +- .../models/ChangePasswordFormTest.php | 6 +- .../models/ChangeUsernameFormTest.php | 4 +- .../models/DisableTwoFactorAuthFormTest.php | 2 +- .../models/EnableTwoFactorAuthFormTest.php | 2 +- .../models/SendEmailVerificationFormTest.php | 2 +- .../SendNewEmailVerificationFormTest.php | 4 +- .../accounts/models/TwoFactorAuthInfoTest.php | 2 +- .../models/AuthenticationFormTest.php | 10 ++-- .../modules/internal/models/BanFormTest.php | 4 +- .../internal/models/PardonFormTest.php | 4 +- .../oauth/models/OauthClientFormTest.php | 4 +- api/tests/unit/request/RequestParserTest.php | 10 ++-- api/tests/unit/traits/AccountFinderTest.php | 4 +- .../EmailActivationKeyValidatorTest.php | 14 ++--- .../PasswordRequiredValidatorTest.php | 4 +- .../unit/validators/TotpValidatorTest.php | 6 +- api/web/index.php | 4 +- common/behaviors/PrimaryKeyValueBehavior.php | 13 +++-- common/components/Mojang/Api.php | 4 +- common/models/UsernameHistory.php | 2 +- common/tests/_bootstrap.php | 6 +- .../tests/unit/behaviors/DataBehaviorTest.php | 4 +- .../EmailActivationExpirationBehaviorTest.php | 2 +- .../tests/unit/components/Mojang/ApiTest.php | 4 +- .../tests/unit/db/mysql/QueryBuilderTest.php | 2 +- common/tests/unit/emails/TemplateTest.php | 12 ++-- .../unit/emails/TemplateWithRendererTest.php | 12 ++-- .../tests/unit/helpers/StringHelperTest.php | 12 ++-- .../tests/unit/models/AccountSessionTest.php | 4 +- common/tests/unit/models/AccountTest.php | 12 ++-- .../unit/tasks/ClearOauthSessionsTest.php | 2 +- .../tests/unit/tasks/DeliveryWebHookTest.php | 4 +- .../unit/tasks/PullMojangUsernameTest.php | 2 +- .../unit/validators/EmailValidatorTest.php | 28 +++++----- .../MinecraftServerAddressValidatorTest.php | 19 ++++--- .../unit/validators/UsernameValidatorTest.php | 26 ++++----- .../unit/validators/UuidValidatorTest.php | 8 +-- composer.json | 3 +- composer.lock | 56 ++++++++----------- ...2_200114_migrate_to_utf8md4_unicode_ci.php | 8 +-- console/tests/_bootstrap.php | 6 +- .../controllers/CleanupControllerTest.php | 12 ++-- yii | 4 +- 67 files changed, 250 insertions(+), 252 deletions(-) diff --git a/.php_cs.dist b/.php_cs.dist index 2fca0ef..4acb35a 100644 --- a/.php_cs.dist +++ b/.php_cs.dist @@ -8,9 +8,8 @@ $finder = \PhpCsFixer\Finder::create() ->notPath('common/mail/layouts') ->notPath('/.*\/runtime/') ->notPath('autocompletion.php') - ->notPath('tests/codeception/_output') - ->notPath('/tests\/codeception\/.*\/_output/') - ->notPath('/tests\/codeception\/.*\/_support\/_generated/') + ->notPath('/.*\/tests\/_output/') + ->notPath('/.*\/tests\/_support\/_generated/') ->name('yii'); return \Ely\CS\Config::create() diff --git a/api/components/User/IdentityInterface.php b/api/components/User/IdentityInterface.php index f9f589f..1228483 100644 --- a/api/components/User/IdentityInterface.php +++ b/api/components/User/IdentityInterface.php @@ -12,7 +12,7 @@ interface IdentityInterface extends \yii\web\IdentityInterface { * @throws \yii\web\UnauthorizedHttpException * @return IdentityInterface */ - public static function findIdentityByAccessToken($token, $type = null): IdentityInterface; + public static function findIdentityByAccessToken($token, $type = null): self; /** * Этот метод используется для получения токена, к которому привязаны права. diff --git a/api/modules/accounts/models/AcceptRulesForm.php b/api/modules/accounts/models/AcceptRulesForm.php index 49ec85a..1ff9842 100644 --- a/api/modules/accounts/models/AcceptRulesForm.php +++ b/api/modules/accounts/models/AcceptRulesForm.php @@ -3,7 +3,7 @@ namespace api\modules\accounts\models; use api\aop\annotations\CollectModelMetrics; use yii\base\ErrorException; -use const \common\LATEST_RULES_VERSION; +use const common\LATEST_RULES_VERSION; class AcceptRulesForm extends AccountActionForm { diff --git a/api/modules/authserver/models/RefreshTokenForm.php b/api/modules/authserver/models/RefreshTokenForm.php index 2deb3b1..282cc18 100644 --- a/api/modules/authserver/models/RefreshTokenForm.php +++ b/api/modules/authserver/models/RefreshTokenForm.php @@ -42,9 +42,7 @@ class RefreshTokenForm extends ApiForm { $accessToken->refreshPrimaryKeyValue(); $accessToken->update(); - $dataModel = new AuthenticateData($accessToken); - - return $dataModel; + return new AuthenticateData($accessToken); } } diff --git a/api/tests/_bootstrap.php b/api/tests/_bootstrap.php index 156889d..e919416 100644 --- a/api/tests/_bootstrap.php +++ b/api/tests/_bootstrap.php @@ -1,8 +1,8 @@ getActor()->sendPOST("/api/v1/oauth2/$clientId/reset" . ($regenerateSecret ? '?regenerateSecret' : '')); + $this->getActor()->sendPOST("/api/v1/oauth2/{$clientId}/reset" . ($regenerateSecret ? '?regenerateSecret' : '')); } public function getClient(string $clientId): void { - $this->getActor()->sendGET("/api/v1/oauth2/$clientId"); + $this->getActor()->sendGET("/api/v1/oauth2/{$clientId}"); } public function getPerAccount(int $accountId): void { - $this->getActor()->sendGET("/api/v1/accounts/$accountId/oauth2/clients"); + $this->getActor()->sendGET("/api/v1/accounts/{$accountId}/oauth2/clients"); } } diff --git a/api/tests/_support/FunctionalTester.php b/api/tests/_support/FunctionalTester.php index 45399cd..d39a6a2 100644 --- a/api/tests/_support/FunctionalTester.php +++ b/api/tests/_support/FunctionalTester.php @@ -16,7 +16,7 @@ class FunctionalTester extends Actor { /** @var Account $account */ $account = Account::findOne(['username' => $asUsername]); if ($account === null) { - throw new InvalidArgumentException("Cannot find account for username \"$asUsername\""); + throw new InvalidArgumentException("Cannot find account for username \"{$asUsername}\""); } $result = Yii::$app->user->createJwtAuthenticationToken($account, false); diff --git a/api/tests/functional/_steps/SessionServerSteps.php b/api/tests/functional/_steps/SessionServerSteps.php index 503320c..65bd9c9 100644 --- a/api/tests/functional/_steps/SessionServerSteps.php +++ b/api/tests/functional/_steps/SessionServerSteps.php @@ -54,8 +54,8 @@ class SessionServerSteps extends FunctionalTester { $decoded = json_decode(base64_decode($value), true); $this->assertArrayHasKey('timestamp', $decoded); $this->assertArrayHasKey('textures', $decoded); - $this->assertEquals($expectedUuid, $decoded['profileId']); - $this->assertEquals($expectedUsername, $decoded['profileName']); + $this->assertSame($expectedUuid, $decoded['profileId']); + $this->assertSame($expectedUsername, $decoded['profileName']); $this->assertTrue($decoded['ely']); $textures = $decoded['textures']; $this->assertArrayHasKey('SKIN', $textures); diff --git a/api/tests/functional/sessionserver/HasJoinedCest.php b/api/tests/functional/sessionserver/HasJoinedCest.php index 0bb3d1c..adfe620 100644 --- a/api/tests/functional/sessionserver/HasJoinedCest.php +++ b/api/tests/functional/sessionserver/HasJoinedCest.php @@ -19,7 +19,7 @@ class HasJoinedCest { public function hasJoined(SessionServerSteps $I) { $I->wantTo('check hasJoined user to some server'); - list($username, $serverId) = $I->amJoined(); + [$username, $serverId] = $I->amJoined(); $this->route->hasJoined([ 'username' => $username, diff --git a/api/tests/functional/sessionserver/HasJoinedLegacyCest.php b/api/tests/functional/sessionserver/HasJoinedLegacyCest.php index 7f7d1d6..de0a852 100644 --- a/api/tests/functional/sessionserver/HasJoinedLegacyCest.php +++ b/api/tests/functional/sessionserver/HasJoinedLegacyCest.php @@ -19,7 +19,7 @@ class HasJoinedLegacyCest { public function hasJoined(SessionServerSteps $I) { $I->wantTo('test hasJoined user to some server by legacy version'); - list($username, $serverId) = $I->amJoined(true); + [$username, $serverId] = $I->amJoined(true); $this->route->hasJoinedLegacy([ 'user' => $username, diff --git a/api/tests/unit/components/ReCaptcha/ValidatorTest.php b/api/tests/unit/components/ReCaptcha/ValidatorTest.php index dc9fc08..f122d09 100644 --- a/api/tests/unit/components/ReCaptcha/ValidatorTest.php +++ b/api/tests/unit/components/ReCaptcha/ValidatorTest.php @@ -14,7 +14,7 @@ class ValidatorTest extends TestCase { public function testValidateEmptyValue() { $validator = new Validator(mock(ClientInterface::class)); $this->assertFalse($validator->validate('', $error)); - $this->assertEquals('error.captcha_required', $error, 'Get error.captcha_required, if passed empty value'); + $this->assertSame('error.captcha_required', $error, 'Get error.captcha_required, if passed empty value'); } public function testValidateInvalidValue() { @@ -28,7 +28,7 @@ class ValidatorTest extends TestCase { $validator = new Validator($mockClient); $this->assertFalse($validator->validate('12341234', $error)); - $this->assertEquals('error.captcha_invalid', $error, 'Get error.captcha_invalid, if passed wrong value'); + $this->assertSame('error.captcha_invalid', $error, 'Get error.captcha_invalid, if passed wrong value'); } public function testValidateWithNetworkTroubles() { diff --git a/api/tests/unit/components/User/ComponentTest.php b/api/tests/unit/components/User/ComponentTest.php index 6998df3..8448bbe 100644 --- a/api/tests/unit/components/User/ComponentTest.php +++ b/api/tests/unit/components/User/ComponentTest.php @@ -45,17 +45,17 @@ class ComponentTest extends TestCase { $result = $this->component->createJwtAuthenticationToken($account, false); $this->assertInstanceOf(AuthenticationResult::class, $result); $this->assertNull($result->getSession()); - $this->assertEquals($account, $result->getAccount()); + $this->assertSame($account, $result->getAccount()); $payloads = (new Jwt())->deserialize($result->getJwt())->getPayload(); /** @noinspection NullPointerExceptionInspection */ - $this->assertEquals(time(), $payloads->findClaimByName(Claim\IssuedAt::NAME)->getValue(), '', 3); + $this->assertEqualsWithDelta(time(), $payloads->findClaimByName(Claim\IssuedAt::NAME)->getValue(), 3); /** @noinspection SummerTimeUnsafeTimeManipulationInspection */ /** @noinspection NullPointerExceptionInspection */ - $this->assertEquals(time() + 60 * 60 * 24 * 7, $payloads->findClaimByName('exp')->getValue(), '', 3); + $this->assertEqualsWithDelta(time() + 60 * 60 * 24 * 7, $payloads->findClaimByName('exp')->getValue(), 3); /** @noinspection NullPointerExceptionInspection */ - $this->assertEquals('ely|1', $payloads->findClaimByName('sub')->getValue()); + $this->assertSame('ely|1', $payloads->findClaimByName('sub')->getValue()); /** @noinspection NullPointerExceptionInspection */ - $this->assertEquals('accounts_web_user', $payloads->findClaimByName('ely-scopes')->getValue()); + $this->assertSame('accounts_web_user', $payloads->findClaimByName('ely-scopes')->getValue()); $this->assertNull($payloads->findClaimByName('jti')); /** @var Account $account */ @@ -63,20 +63,20 @@ class ComponentTest extends TestCase { $result = $this->component->createJwtAuthenticationToken($account, true); $this->assertInstanceOf(AuthenticationResult::class, $result); $this->assertInstanceOf(AccountSession::class, $result->getSession()); - $this->assertEquals($account, $result->getAccount()); + $this->assertSame($account, $result->getAccount()); /** @noinspection NullPointerExceptionInspection */ $this->assertTrue($result->getSession()->refresh()); $payloads = (new Jwt())->deserialize($result->getJwt())->getPayload(); /** @noinspection NullPointerExceptionInspection */ - $this->assertEquals(time(), $payloads->findClaimByName(Claim\IssuedAt::NAME)->getValue(), '', 3); + $this->assertEqualsWithDelta(time(), $payloads->findClaimByName(Claim\IssuedAt::NAME)->getValue(), 3); /** @noinspection NullPointerExceptionInspection */ - $this->assertEquals(time() + 3600, $payloads->findClaimByName('exp')->getValue(), '', 3); + $this->assertEqualsWithDelta(time() + 3600, $payloads->findClaimByName('exp')->getValue(), 3); /** @noinspection NullPointerExceptionInspection */ - $this->assertEquals('ely|1', $payloads->findClaimByName('sub')->getValue()); + $this->assertSame('ely|1', $payloads->findClaimByName('sub')->getValue()); /** @noinspection NullPointerExceptionInspection */ - $this->assertEquals('accounts_web_user', $payloads->findClaimByName('ely-scopes')->getValue()); + $this->assertSame('accounts_web_user', $payloads->findClaimByName('ely-scopes')->getValue()); /** @noinspection NullPointerExceptionInspection */ - $this->assertEquals($result->getSession()->id, $payloads->findClaimByName('jti')->getValue()); + $this->assertSame($result->getSession()->id, $payloads->findClaimByName('jti')->getValue()); } public function testRenewJwtAuthenticationToken() { @@ -85,23 +85,22 @@ class ComponentTest extends TestCase { /** @var AccountSession $session */ $session = $this->tester->grabFixture('sessions', 'admin'); $result = $this->component->renewJwtAuthenticationToken($session); - $this->assertInstanceOf(AuthenticationResult::class, $result); - $this->assertEquals($session, $result->getSession()); - $this->assertEquals($session->account_id, $result->getAccount()->id); + $this->assertSame($session, $result->getSession()); + $this->assertSame($session->account_id, $result->getAccount()->id); $session->refresh(); // reload data from db - $this->assertEquals(time(), $session->last_refreshed_at, '', 3); - $this->assertEquals($userIP, $session->getReadableIp()); + $this->assertEqualsWithDelta(time(), $session->last_refreshed_at, 3); + $this->assertSame($userIP, $session->getReadableIp()); $payloads = (new Jwt())->deserialize($result->getJwt())->getPayload(); /** @noinspection NullPointerExceptionInspection */ - $this->assertEquals(time(), $payloads->findClaimByName(Claim\IssuedAt::NAME)->getValue(), '', 3); + $this->assertEqualsWithDelta(time(), $payloads->findClaimByName(Claim\IssuedAt::NAME)->getValue(), 3); /** @noinspection NullPointerExceptionInspection */ - $this->assertEquals(time() + 3600, $payloads->findClaimByName('exp')->getValue(), '', 3); + $this->assertEqualsWithDelta(time() + 3600, $payloads->findClaimByName('exp')->getValue(), 3); /** @noinspection NullPointerExceptionInspection */ - $this->assertEquals('ely|1', $payloads->findClaimByName('sub')->getValue()); + $this->assertSame('ely|1', $payloads->findClaimByName('sub')->getValue()); /** @noinspection NullPointerExceptionInspection */ - $this->assertEquals('accounts_web_user', $payloads->findClaimByName('ely-scopes')->getValue()); + $this->assertSame('accounts_web_user', $payloads->findClaimByName('ely-scopes')->getValue()); /** @noinspection NullPointerExceptionInspection */ - $this->assertEquals($session->id, $payloads->findClaimByName('jti')->getValue(), 'session has not changed'); + $this->assertSame($session->id, $payloads->findClaimByName('jti')->getValue(), 'session has not changed'); } public function testParseToken() { @@ -123,7 +122,6 @@ class ComponentTest extends TestCase { ->getMock(); $component - ->expects($this->any()) ->method('getIsGuest') ->willReturn(false); @@ -132,7 +130,7 @@ class ComponentTest extends TestCase { $session = $component->getActiveSession(); $this->assertInstanceOf(AccountSession::class, $session); /** @noinspection NullPointerExceptionInspection */ - $this->assertEquals($session->id, $result->getSession()->id); + $this->assertSame($session->id, $result->getSession()->id); } public function testTerminateSessions() { @@ -157,8 +155,8 @@ class ComponentTest extends TestCase { $component->terminateSessions($account, Component::KEEP_CURRENT_SESSION); $sessions = $account->getSessions()->all(); - $this->assertEquals(1, count($sessions)); - $this->assertTrue($sessions[0]->id === $session->id); + $this->assertCount(1, $sessions); + $this->assertSame($session->id, $sessions[0]->id); $component->terminateSessions($account); $this->assertEmpty($account->getSessions()->all()); diff --git a/api/tests/unit/components/User/JwtAuthenticationResultTest.php b/api/tests/unit/components/User/JwtAuthenticationResultTest.php index 7e029d4..29c636d 100644 --- a/api/tests/unit/components/User/JwtAuthenticationResultTest.php +++ b/api/tests/unit/components/User/JwtAuthenticationResultTest.php @@ -17,12 +17,12 @@ class JwtAuthenticationResultTest extends TestCase { $account = new Account(); $account->id = 123; $model = new AuthenticationResult($account, '', null); - $this->assertEquals($account, $model->getAccount()); + $this->assertSame($account, $model->getAccount()); } public function testGetJwt() { $model = new AuthenticationResult(new Account(), 'mocked jwt', null); - $this->assertEquals('mocked jwt', $model->getJwt()); + $this->assertSame('mocked jwt', $model->getJwt()); } public function testGetSession() { @@ -32,14 +32,14 @@ class JwtAuthenticationResultTest extends TestCase { $session = new AccountSession(); $session->id = 321; $model = new AuthenticationResult(new Account(), '', $session); - $this->assertEquals($session, $model->getSession()); + $this->assertSame($session, $model->getSession()); } public function testGetAsResponse() { $jwtToken = $this->createJwtToken(time() + 3600); $model = new AuthenticationResult(new Account(), $jwtToken, null); $result = $model->getAsResponse(); - $this->assertEquals($jwtToken, $result['access_token']); + $this->assertSame($jwtToken, $result['access_token']); $this->assertSame(3600, $result['expires_in']); /** @noinspection SummerTimeUnsafeTimeManipulationInspection */ @@ -48,8 +48,8 @@ class JwtAuthenticationResultTest extends TestCase { $session->refresh_token = 'refresh token'; $model = new AuthenticationResult(new Account(), $jwtToken, $session); $result = $model->getAsResponse(); - $this->assertEquals($jwtToken, $result['access_token']); - $this->assertEquals('refresh token', $result['refresh_token']); + $this->assertSame($jwtToken, $result['access_token']); + $this->assertSame('refresh token', $result['refresh_token']); $this->assertSame(86400, $result['expires_in']); } diff --git a/api/tests/unit/models/JwtIdentityTest.php b/api/tests/unit/models/JwtIdentityTest.php index 432f37d..fdeb957 100644 --- a/api/tests/unit/models/JwtIdentityTest.php +++ b/api/tests/unit/models/JwtIdentityTest.php @@ -27,8 +27,8 @@ class JwtIdentityTest extends TestCase { $token = $this->generateToken(); $identity = JwtIdentity::findIdentityByAccessToken($token); $this->assertInstanceOf(IdentityInterface::class, $identity); - $this->assertEquals($token, $identity->getId()); - $this->assertEquals($this->tester->grabFixture('accounts', 'admin')['id'], $identity->getAccount()->id); + $this->assertSame($token, $identity->getId()); + $this->assertSame($this->tester->grabFixture('accounts', 'admin')['id'], $identity->getAccount()->id); } /** diff --git a/api/tests/unit/models/authentication/ConfirmEmailFormTest.php b/api/tests/unit/models/authentication/ConfirmEmailFormTest.php index 534d13e..db808d5 100644 --- a/api/tests/unit/models/authentication/ConfirmEmailFormTest.php +++ b/api/tests/unit/models/authentication/ConfirmEmailFormTest.php @@ -27,7 +27,7 @@ class ConfirmEmailFormTest extends TestCase { $this->assertFalse($activationExists, 'email activation key is not exist'); /** @var Account $account */ $account = Account::findOne($fixture['account_id']); - $this->assertEquals(Account::STATUS_ACTIVE, $account->status, 'user status changed to active'); + $this->assertSame(Account::STATUS_ACTIVE, $account->status, 'user status changed to active'); } private function createModel($key) { diff --git a/api/tests/unit/models/authentication/ForgotPasswordFormTest.php b/api/tests/unit/models/authentication/ForgotPasswordFormTest.php index 1a4caf1..8dc639a 100644 --- a/api/tests/unit/models/authentication/ForgotPasswordFormTest.php +++ b/api/tests/unit/models/authentication/ForgotPasswordFormTest.php @@ -16,7 +16,7 @@ use Yii; class ForgotPasswordFormTest extends TestCase { use Specify; - public function setUp() { + protected function setUp() { parent::setUp(); Yii::$container->set(ReCaptchaValidator::class, new class(mock(ClientInterface::class)) extends ReCaptchaValidator { public function validateValue($value) { @@ -35,7 +35,7 @@ class ForgotPasswordFormTest extends TestCase { public function testValidateLogin() { $model = new ForgotPasswordForm(['login' => 'unexist']); $model->validateLogin('login'); - $this->assertEquals(['error.login_not_exist'], $model->getErrors('login'), 'error.login_not_exist if login is invalid'); + $this->assertSame(['error.login_not_exist'], $model->getErrors('login'), 'error.login_not_exist if login is invalid'); $model = new ForgotPasswordForm(['login' => $this->tester->grabFixture('accounts', 'admin')['username']]); $model->validateLogin('login'); @@ -47,7 +47,7 @@ class ForgotPasswordFormTest extends TestCase { 'login' => $this->tester->grabFixture('accounts', 'not-activated-account')['username'], ]); $model->validateActivity('login'); - $this->assertEquals(['error.account_not_activated'], $model->getErrors('login'), 'expected error if account is not confirmed'); + $this->assertSame(['error.account_not_activated'], $model->getErrors('login'), 'expected error if account is not confirmed'); $model = new ForgotPasswordForm([ 'login' => $this->tester->grabFixture('accounts', 'admin')['username'], @@ -62,7 +62,7 @@ class ForgotPasswordFormTest extends TestCase { 'key' => $this->tester->grabFixture('emailActivations', 'freshPasswordRecovery')['key'], ]); $model->validateFrequency('login'); - $this->assertEquals(['error.recently_sent_message'], $model->getErrors('login'), 'error.account_not_activated if recently was message'); + $this->assertSame(['error.recently_sent_message'], $model->getErrors('login'), 'error.account_not_activated if recently was message'); $model = $this->createModel([ 'login' => $this->tester->grabFixture('accounts', 'admin')['username'], diff --git a/api/tests/unit/models/authentication/LoginFormTest.php b/api/tests/unit/models/authentication/LoginFormTest.php index a5b32d2..d3285fb 100644 --- a/api/tests/unit/models/authentication/LoginFormTest.php +++ b/api/tests/unit/models/authentication/LoginFormTest.php @@ -14,13 +14,13 @@ class LoginFormTest extends TestCase { private $originalRemoteAddr; - public function setUp() { + protected function setUp() { $this->originalRemoteAddr = $_SERVER['REMOTE_ADDR'] ?? null; $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; parent::setUp(); } - public function tearDown() { + protected function tearDown() { parent::tearDown(); $_SERVER['REMOTE_ADDR'] = $this->originalRemoteAddr; } @@ -38,7 +38,7 @@ class LoginFormTest extends TestCase { 'account' => null, ]); $model->validateLogin('login'); - $this->assertEquals(['error.login_not_exist'], $model->getErrors('login')); + $this->assertSame(['error.login_not_exist'], $model->getErrors('login')); }); $this->specify('no errors if login exists', function() { @@ -58,7 +58,7 @@ class LoginFormTest extends TestCase { 'account' => new Account(['password' => '12345678']), ]); $model->validatePassword('password'); - $this->assertEquals(['error.password_incorrect'], $model->getErrors('password')); + $this->assertSame(['error.password_incorrect'], $model->getErrors('password')); }); $this->specify('no errors if password valid', function() { @@ -84,7 +84,7 @@ class LoginFormTest extends TestCase { 'account' => $account, ]); $model->validateTotp('totp'); - $this->assertEquals(['error.totp_incorrect'], $model->getErrors('totp')); + $this->assertSame(['error.totp_incorrect'], $model->getErrors('totp')); }); $totp = TOTP::create($account->otp_secret); @@ -105,7 +105,7 @@ class LoginFormTest extends TestCase { 'account' => new Account(['status' => Account::STATUS_REGISTERED]), ]); $model->validateActivity('login'); - $this->assertEquals(['error.account_not_activated'], $model->getErrors('login')); + $this->assertSame(['error.account_not_activated'], $model->getErrors('login')); }); $this->specify('error.account_banned if account has banned status', function() { @@ -113,7 +113,7 @@ class LoginFormTest extends TestCase { 'account' => new Account(['status' => Account::STATUS_BANNED]), ]); $model->validateActivity('login'); - $this->assertEquals(['error.account_banned'], $model->getErrors('login')); + $this->assertSame(['error.account_banned'], $model->getErrors('login')); }); $this->specify('no errors if account active', function() { @@ -146,7 +146,7 @@ class LoginFormTest extends TestCase { ]); $this->assertInstanceOf(AuthenticationResult::class, $model->login()); $this->assertEmpty($model->getErrors()); - $this->assertEquals( + $this->assertSame( Account::PASS_HASH_STRATEGY_YII2, $model->getAccount()->password_hash_strategy, 'user, that login using account with old pass hash strategy should update it automatically' diff --git a/api/tests/unit/models/authentication/RefreshTokenFormTest.php b/api/tests/unit/models/authentication/RefreshTokenFormTest.php index 16308a4..b4628f1 100644 --- a/api/tests/unit/models/authentication/RefreshTokenFormTest.php +++ b/api/tests/unit/models/authentication/RefreshTokenFormTest.php @@ -26,7 +26,7 @@ class RefreshTokenFormTest extends TestCase { } }; $model->validateRefreshToken(); - $this->assertEquals(['error.refresh_token_not_exist'], $model->getErrors('refresh_token')); + $this->assertSame(['error.refresh_token_not_exist'], $model->getErrors('refresh_token')); }); $this->specify('no errors if token exists', function() { diff --git a/api/tests/unit/models/authentication/RegistrationFormTest.php b/api/tests/unit/models/authentication/RegistrationFormTest.php index f1939d5..cd37cda 100644 --- a/api/tests/unit/models/authentication/RegistrationFormTest.php +++ b/api/tests/unit/models/authentication/RegistrationFormTest.php @@ -20,7 +20,7 @@ use const common\LATEST_RULES_VERSION; class RegistrationFormTest extends TestCase { - public function setUp() { + protected function setUp() { parent::setUp(); $this->mockRequest(); Yii::$container->set(ReCaptchaValidator::class, new class(mock(ClientInterface::class)) extends ReCaptchaValidator { @@ -68,7 +68,7 @@ class RegistrationFormTest extends TestCase { $account = $model->signup(); $this->expectSuccessRegistration($account); - $this->assertEquals('ru', $account->lang, 'lang is set'); + $this->assertSame('ru', $account->lang, 'lang is set'); } public function testSignupWithDefaultLanguage() { @@ -84,7 +84,7 @@ class RegistrationFormTest extends TestCase { $account = $model->signup(); $this->expectSuccessRegistration($account); - $this->assertEquals('en', $account->lang, 'lang is set'); + $this->assertSame('en', $account->lang, 'lang is set'); } /** @@ -95,7 +95,7 @@ class RegistrationFormTest extends TestCase { $this->assertTrue($account->validatePassword('some_password'), 'password should be correct'); $this->assertNotEmpty($account->uuid, 'uuid is set'); $this->assertNotNull($account->registration_ip, 'registration_ip is set'); - $this->assertEquals(LATEST_RULES_VERSION, $account->rules_agreement_version, 'actual rules version is set'); + $this->assertSame(LATEST_RULES_VERSION, $account->rules_agreement_version, 'actual rules version is set'); $this->assertTrue(Account::find()->andWhere([ 'username' => 'some_username', 'email' => 'some_email@example.com', diff --git a/api/tests/unit/models/authentication/RepeatAccountActivationFormTest.php b/api/tests/unit/models/authentication/RepeatAccountActivationFormTest.php index 3a6162b..c70a364 100644 --- a/api/tests/unit/models/authentication/RepeatAccountActivationFormTest.php +++ b/api/tests/unit/models/authentication/RepeatAccountActivationFormTest.php @@ -15,7 +15,7 @@ use Yii; class RepeatAccountActivationFormTest extends TestCase { use Specify; - public function setUp() { + protected function setUp() { parent::setUp(); Yii::$container->set(ReCaptchaValidator::class, new class(mock(ClientInterface::class)) extends ReCaptchaValidator { public function validateValue($value) { diff --git a/api/tests/unit/models/base/ApiFormTest.php b/api/tests/unit/models/base/ApiFormTest.php index 632a1f7..d422692 100644 --- a/api/tests/unit/models/base/ApiFormTest.php +++ b/api/tests/unit/models/base/ApiFormTest.php @@ -9,7 +9,7 @@ class ApiFormTest extends TestCase { public function testLoad() { $model = new DummyApiForm(); $this->assertTrue($model->load(['field' => 'test-data']), 'model successful load data without prefix'); - $this->assertEquals('test-data', $model->field, 'field is set as passed data'); + $this->assertSame('test-data', $model->field, 'field is set as passed data'); } } diff --git a/api/tests/unit/modules/accounts/models/AcceptRulesFormTest.php b/api/tests/unit/modules/accounts/models/AcceptRulesFormTest.php index c354cef..0c5f92f 100644 --- a/api/tests/unit/modules/accounts/models/AcceptRulesFormTest.php +++ b/api/tests/unit/modules/accounts/models/AcceptRulesFormTest.php @@ -16,7 +16,7 @@ class AcceptRulesFormTest extends TestCase { $model = new AcceptRulesForm($account); $this->assertTrue($model->performAction()); - $this->assertEquals(LATEST_RULES_VERSION, $account->rules_agreement_version); + $this->assertSame(LATEST_RULES_VERSION, $account->rules_agreement_version); } } diff --git a/api/tests/unit/modules/accounts/models/ChangeEmailFormTest.php b/api/tests/unit/modules/accounts/models/ChangeEmailFormTest.php index a8f7c14..7106fca 100644 --- a/api/tests/unit/modules/accounts/models/ChangeEmailFormTest.php +++ b/api/tests/unit/modules/accounts/models/ChangeEmailFormTest.php @@ -31,7 +31,7 @@ class ChangeEmailFormTest extends TestCase { ])); /** @noinspection UnserializeExploitsInspection */ $data = unserialize($newEmailConfirmationFixture['_data']); - $this->assertEquals($data['newEmail'], $account->email); + $this->assertSame($data['newEmail'], $account->email); } private function getAccountId() { diff --git a/api/tests/unit/modules/accounts/models/ChangeLanguageFormTest.php b/api/tests/unit/modules/accounts/models/ChangeLanguageFormTest.php index 890aa17..1cb1337 100644 --- a/api/tests/unit/modules/accounts/models/ChangeLanguageFormTest.php +++ b/api/tests/unit/modules/accounts/models/ChangeLanguageFormTest.php @@ -15,7 +15,7 @@ class ChangeLanguageFormTest extends TestCase { $model = new ChangeLanguageForm($account); $model->lang = 'ru'; $this->assertTrue($model->performAction()); - $this->assertEquals('ru', $account->lang); + $this->assertSame('ru', $account->lang); } } diff --git a/api/tests/unit/modules/accounts/models/ChangePasswordFormTest.php b/api/tests/unit/modules/accounts/models/ChangePasswordFormTest.php index 36dc32c..552a185 100644 --- a/api/tests/unit/modules/accounts/models/ChangePasswordFormTest.php +++ b/api/tests/unit/modules/accounts/models/ChangePasswordFormTest.php @@ -22,7 +22,7 @@ class ChangePasswordFormTest extends TestCase { 'newRePassword' => 'another-password', ]); $model->validatePasswordAndRePasswordMatch('newRePassword'); - $this->assertEquals( + $this->assertSame( [E::NEW_RE_PASSWORD_DOES_NOT_MATCH], $model->getErrors('newRePassword'), 'error.rePassword_does_not_match expected if passwords not match' @@ -47,7 +47,7 @@ class ChangePasswordFormTest extends TestCase { 'newRePassword' => 'another-password', ]); $model->validate(); - $this->assertEquals( + $this->assertSame( [E::NEW_RE_PASSWORD_DOES_NOT_MATCH], $model->getErrors('newRePassword'), 'error.rePassword_does_not_match expected even if there are errors on other attributes' @@ -106,7 +106,7 @@ class ChangePasswordFormTest extends TestCase { $this->assertTrue($model->performAction(), 'successfully change password with legacy hash strategy'); $this->assertTrue($account->validatePassword('my-new-password')); $this->assertGreaterThanOrEqual($callTime, $account->password_changed_at); - $this->assertEquals(Account::PASS_HASH_STRATEGY_YII2, $account->password_hash_strategy); + $this->assertSame(Account::PASS_HASH_STRATEGY_YII2, $account->password_hash_strategy); } public function testPerformActionWithLogout() { diff --git a/api/tests/unit/modules/accounts/models/ChangeUsernameFormTest.php b/api/tests/unit/modules/accounts/models/ChangeUsernameFormTest.php index fad9db4..60cc365 100644 --- a/api/tests/unit/modules/accounts/models/ChangeUsernameFormTest.php +++ b/api/tests/unit/modules/accounts/models/ChangeUsernameFormTest.php @@ -24,7 +24,7 @@ class ChangeUsernameFormTest extends TestCase { 'username' => 'my_new_nickname', ]); $this->assertTrue($model->performAction()); - $this->assertEquals('my_new_nickname', Account::findOne($this->getAccountId())->username); + $this->assertSame('my_new_nickname', Account::findOne($this->getAccountId())->username); $this->assertInstanceOf(UsernameHistory::class, UsernameHistory::findOne(['username' => 'my_new_nickname'])); /** @var PullMojangUsername $job */ $job = $this->tester->grabLastQueuedJob(); @@ -56,7 +56,7 @@ class ChangeUsernameFormTest extends TestCase { 'username' => $newUsername, ]); $this->assertTrue($model->performAction()); - $this->assertEquals($newUsername, Account::findOne($this->getAccountId())->username); + $this->assertSame($newUsername, Account::findOne($this->getAccountId())->username); $this->assertInstanceOf( UsernameHistory::class, UsernameHistory::findOne(['username' => $newUsername]), diff --git a/api/tests/unit/modules/accounts/models/DisableTwoFactorAuthFormTest.php b/api/tests/unit/modules/accounts/models/DisableTwoFactorAuthFormTest.php index 618c53d..b2eda1e 100644 --- a/api/tests/unit/modules/accounts/models/DisableTwoFactorAuthFormTest.php +++ b/api/tests/unit/modules/accounts/models/DisableTwoFactorAuthFormTest.php @@ -30,7 +30,7 @@ class DisableTwoFactorAuthFormTest extends TestCase { $account->is_otp_enabled = false; $model = new DisableTwoFactorAuthForm($account); $model->validateOtpEnabled('account'); - $this->assertEquals([E::OTP_NOT_ENABLED], $model->getErrors('account')); + $this->assertSame([E::OTP_NOT_ENABLED], $model->getErrors('account')); $account = new Account(); $account->is_otp_enabled = true; diff --git a/api/tests/unit/modules/accounts/models/EnableTwoFactorAuthFormTest.php b/api/tests/unit/modules/accounts/models/EnableTwoFactorAuthFormTest.php index 4bacfe4..84878ff 100644 --- a/api/tests/unit/modules/accounts/models/EnableTwoFactorAuthFormTest.php +++ b/api/tests/unit/modules/accounts/models/EnableTwoFactorAuthFormTest.php @@ -42,7 +42,7 @@ class EnableTwoFactorAuthFormTest extends TestCase { $account->is_otp_enabled = true; $model = new EnableTwoFactorAuthForm($account); $model->validateOtpDisabled('account'); - $this->assertEquals([E::OTP_ALREADY_ENABLED], $model->getErrors('account')); + $this->assertSame([E::OTP_ALREADY_ENABLED], $model->getErrors('account')); $account = new Account(); $account->is_otp_enabled = false; diff --git a/api/tests/unit/modules/accounts/models/SendEmailVerificationFormTest.php b/api/tests/unit/modules/accounts/models/SendEmailVerificationFormTest.php index 52ed48c..8a9b967 100644 --- a/api/tests/unit/modules/accounts/models/SendEmailVerificationFormTest.php +++ b/api/tests/unit/modules/accounts/models/SendEmailVerificationFormTest.php @@ -25,7 +25,7 @@ class SendEmailVerificationFormTest extends TestCase { $model = new SendEmailVerificationForm($account); $activationModel = $model->createCode(); $this->assertInstanceOf(CurrentEmailConfirmation::class, $activationModel); - $this->assertEquals($account->id, $activationModel->account_id); + $this->assertSame($account->id, $activationModel->account_id); $this->assertNotNull(EmailActivation::findOne($activationModel->key)); } diff --git a/api/tests/unit/modules/accounts/models/SendNewEmailVerificationFormTest.php b/api/tests/unit/modules/accounts/models/SendNewEmailVerificationFormTest.php index 64023c7..529190d 100644 --- a/api/tests/unit/modules/accounts/models/SendNewEmailVerificationFormTest.php +++ b/api/tests/unit/modules/accounts/models/SendNewEmailVerificationFormTest.php @@ -28,8 +28,8 @@ class SendNewEmailVerificationFormTest extends TestCase { $model->email = 'my-new-email@ely.by'; $activationModel = $model->createCode(); $this->assertInstanceOf(NewEmailConfirmation::class, $activationModel); - $this->assertEquals($account->id, $activationModel->account_id); - $this->assertEquals($model->email, $activationModel->newEmail); + $this->assertSame($account->id, $activationModel->account_id); + $this->assertSame($model->email, $activationModel->newEmail); $this->assertNotNull(EmailActivation::findOne($activationModel->key)); } diff --git a/api/tests/unit/modules/accounts/models/TwoFactorAuthInfoTest.php b/api/tests/unit/modules/accounts/models/TwoFactorAuthInfoTest.php index ee5d455..bb78ee1 100644 --- a/api/tests/unit/modules/accounts/models/TwoFactorAuthInfoTest.php +++ b/api/tests/unit/modules/accounts/models/TwoFactorAuthInfoTest.php @@ -41,7 +41,7 @@ class TwoFactorAuthInfoTest extends TestCase { $model = new TwoFactorAuthInfo($account); $result = $model->getCredentials(); - $this->assertEquals('AAAA', $result['secret']); + $this->assertSame('AAAA', $result['secret']); } } diff --git a/api/tests/unit/modules/authserver/models/AuthenticationFormTest.php b/api/tests/unit/modules/authserver/models/AuthenticationFormTest.php index 5395a86..ca8b21f 100644 --- a/api/tests/unit/modules/authserver/models/AuthenticationFormTest.php +++ b/api/tests/unit/modules/authserver/models/AuthenticationFormTest.php @@ -79,7 +79,7 @@ class AuthenticationFormTest extends TestCase { $result = $authForm->authenticate(); $this->assertInstanceOf(AuthenticateData::class, $result); - $this->assertEquals($minecraftAccessKey->access_token, $result->getMinecraftAccessKey()->access_token); + $this->assertSame($minecraftAccessKey->access_token, $result->getMinecraftAccessKey()->access_token); } public function testCreateMinecraftAccessToken() { @@ -90,8 +90,8 @@ class AuthenticationFormTest extends TestCase { /** @var MinecraftAccessKey $result */ $result = $this->callProtected($authForm, 'createMinecraftAccessToken', $account); $this->assertInstanceOf(MinecraftAccessKey::class, $result); - $this->assertEquals($account->id, $result->account_id); - $this->assertEquals($authForm->clientToken, $result->client_token); + $this->assertSame($account->id, $result->account_id); + $this->assertSame($authForm->clientToken, $result->client_token); $this->assertInstanceOf(MinecraftAccessKey::class, MinecraftAccessKey::findOne($result->access_token)); } @@ -104,8 +104,8 @@ class AuthenticationFormTest extends TestCase { /** @var MinecraftAccessKey $result */ $result = $this->callProtected($authForm, 'createMinecraftAccessToken', $account); $this->assertInstanceOf(MinecraftAccessKey::class, $result); - $this->assertEquals($account->id, $result->account_id); - $this->assertEquals($authForm->clientToken, $result->client_token); + $this->assertSame($account->id, $result->account_id); + $this->assertSame($authForm->clientToken, $result->client_token); $this->assertNull(MinecraftAccessKey::findOne($minecraftFixture['access_token'])); $this->assertInstanceOf(MinecraftAccessKey::class, MinecraftAccessKey::findOne($result->access_token)); } diff --git a/api/tests/unit/modules/internal/models/BanFormTest.php b/api/tests/unit/modules/internal/models/BanFormTest.php index 48f53dd..7dd9ea3 100644 --- a/api/tests/unit/modules/internal/models/BanFormTest.php +++ b/api/tests/unit/modules/internal/models/BanFormTest.php @@ -20,7 +20,7 @@ class BanFormTest extends TestCase { $account->status = Account::STATUS_BANNED; $form = new BanAccountForm($account); $form->validateAccountActivity(); - $this->assertEquals([E::ACCOUNT_ALREADY_BANNED], $form->getErrors('account')); + $this->assertSame([E::ACCOUNT_ALREADY_BANNED], $form->getErrors('account')); } public function testBan() { @@ -35,7 +35,7 @@ class BanFormTest extends TestCase { $model = new BanAccountForm($account); $this->assertTrue($model->performAction()); - $this->assertEquals(Account::STATUS_BANNED, $account->status); + $this->assertSame(Account::STATUS_BANNED, $account->status); /** @var ClearAccountSessions $job */ $job = $this->tester->grabLastQueuedJob(); $this->assertInstanceOf(ClearAccountSessions::class, $job); diff --git a/api/tests/unit/modules/internal/models/PardonFormTest.php b/api/tests/unit/modules/internal/models/PardonFormTest.php index 4ae4438..5d469e6 100644 --- a/api/tests/unit/modules/internal/models/PardonFormTest.php +++ b/api/tests/unit/modules/internal/models/PardonFormTest.php @@ -19,7 +19,7 @@ class PardonFormTest extends TestCase { $account->status = Account::STATUS_ACTIVE; $form = new PardonAccountForm($account); $form->validateAccountBanned(); - $this->assertEquals([E::ACCOUNT_NOT_BANNED], $form->getErrors('account')); + $this->assertSame([E::ACCOUNT_NOT_BANNED], $form->getErrors('account')); } public function testPardon() { @@ -35,7 +35,7 @@ class PardonFormTest extends TestCase { $account->status = Account::STATUS_BANNED; $model = new PardonAccountForm($account); $this->assertTrue($model->performAction()); - $this->assertEquals(Account::STATUS_ACTIVE, $account->status); + $this->assertSame(Account::STATUS_ACTIVE, $account->status); } } diff --git a/api/tests/unit/modules/oauth/models/OauthClientFormTest.php b/api/tests/unit/modules/oauth/models/OauthClientFormTest.php index 58820db..de0303f 100644 --- a/api/tests/unit/modules/oauth/models/OauthClientFormTest.php +++ b/api/tests/unit/modules/oauth/models/OauthClientFormTest.php @@ -114,7 +114,7 @@ class OauthClientFormTest extends TestCase { $job = $this->tester->grabLastQueuedJob(); $this->assertInstanceOf(ClearOauthSessions::class, $job); $this->assertSame('mocked-id', $job->clientId); - $this->assertEquals(time(), $job->notSince, '', 2); + $this->assertEqualsWithDelta(time(), $job->notSince, 2); } public function testResetWithSecret() { @@ -132,7 +132,7 @@ class OauthClientFormTest extends TestCase { $job = $this->tester->grabLastQueuedJob(); $this->assertInstanceOf(ClearOauthSessions::class, $job); $this->assertSame('mocked-id', $job->clientId); - $this->assertEquals(time(), $job->notSince, '', 2); + $this->assertEqualsWithDelta(time(), $job->notSince, 2); } } diff --git a/api/tests/unit/request/RequestParserTest.php b/api/tests/unit/request/RequestParserTest.php index 97962b7..0756d86 100644 --- a/api/tests/unit/request/RequestParserTest.php +++ b/api/tests/unit/request/RequestParserTest.php @@ -9,12 +9,12 @@ class RequestParserTest extends TestCase { public function testParse() { $parser = new RequestParser(); $_POST = ['from' => 'post']; - $this->assertEquals(['from' => 'post'], $parser->parse('from=post', '')); - $this->assertEquals(['from' => 'post'], $parser->parse('', '')); + $this->assertSame(['from' => 'post'], $parser->parse('from=post', '')); + $this->assertSame(['from' => 'post'], $parser->parse('', '')); $_POST = []; - $this->assertEquals(['from' => 'json'], $parser->parse('{"from":"json"}', '')); - $this->assertEquals(['from' => 'body'], $parser->parse('from=body', '')); - $this->assertEquals(['onlykey' => ''], $parser->parse('onlykey', '')); + $this->assertSame(['from' => 'json'], $parser->parse('{"from":"json"}', '')); + $this->assertSame(['from' => 'body'], $parser->parse('from=body', '')); + $this->assertSame(['onlykey' => ''], $parser->parse('onlykey', '')); } } diff --git a/api/tests/unit/traits/AccountFinderTest.php b/api/tests/unit/traits/AccountFinderTest.php index 967a4c0..63c4a4c 100644 --- a/api/tests/unit/traits/AccountFinderTest.php +++ b/api/tests/unit/traits/AccountFinderTest.php @@ -33,11 +33,11 @@ class AccountFinderTest extends TestCase { public function testGetLoginAttribute() { $model = new AccountFinderTestTestClass(); $model->login = 'erickskrauch@ely.by'; - $this->assertEquals('email', $model->getLoginAttribute(), 'if login look like email value, then \'email\''); + $this->assertSame('email', $model->getLoginAttribute(), 'if login look like email value, then \'email\''); $model = new AccountFinderTestTestClass(); $model->login = 'erickskrauch'; - $this->assertEquals('username', $model->getLoginAttribute(), 'username in any other case'); + $this->assertSame('username', $model->getLoginAttribute(), 'username in any other case'); } } diff --git a/api/tests/unit/validators/EmailActivationKeyValidatorTest.php b/api/tests/unit/validators/EmailActivationKeyValidatorTest.php index 6467851..f58c323 100644 --- a/api/tests/unit/validators/EmailActivationKeyValidatorTest.php +++ b/api/tests/unit/validators/EmailActivationKeyValidatorTest.php @@ -36,24 +36,24 @@ class EmailActivationKeyValidatorTest extends TestCase { ->willReturnOnConsecutiveCalls(null, $expiredActivation, $validActivation); $validator->validateAttribute($model, 'key'); - $this->assertEquals([E::KEY_REQUIRED], $model->getErrors('key')); + $this->assertSame([E::KEY_REQUIRED], $model->getErrors('key')); $this->assertNull($model->key); $model->clearErrors(); $model->key = 'original value'; $validator->validateAttribute($model, 'key'); - $this->assertEquals([E::KEY_NOT_EXISTS], $model->getErrors('key')); - $this->assertEquals('original value', $model->key); + $this->assertSame([E::KEY_NOT_EXISTS], $model->getErrors('key')); + $this->assertSame('original value', $model->key); $model->clearErrors(); $validator->validateAttribute($model, 'key'); - $this->assertEquals([E::KEY_EXPIRE], $model->getErrors('key')); - $this->assertEquals('original value', $model->key); + $this->assertSame([E::KEY_EXPIRE], $model->getErrors('key')); + $this->assertSame('original value', $model->key); $model->clearErrors(); $validator->validateAttribute($model, 'key'); $this->assertEmpty($model->getErrors('key')); - $this->assertEquals($validActivation, $model->key); + $this->assertSame($validActivation, $model->key); } public function testFindEmailActivationModel() { @@ -64,7 +64,7 @@ class EmailActivationKeyValidatorTest extends TestCase { /** @var EmailActivation $result */ $result = $this->callProtected($model, 'findEmailActivationModel', $key); $this->assertInstanceOf(EmailActivation::class, $result, 'valid key without specifying type must return model'); - $this->assertEquals($key, $result->key); + $this->assertSame($key, $result->key); /** @var EmailActivation $result */ $result = $this->callProtected($model, 'findEmailActivationModel', $key, 0); diff --git a/api/tests/unit/validators/PasswordRequiredValidatorTest.php b/api/tests/unit/validators/PasswordRequiredValidatorTest.php index aaffc40..f60aed6 100644 --- a/api/tests/unit/validators/PasswordRequiredValidatorTest.php +++ b/api/tests/unit/validators/PasswordRequiredValidatorTest.php @@ -17,10 +17,10 @@ class PasswordRequiredValidatorTest extends TestCase { $model = new PasswordRequiredValidator(['account' => $account]); // Get error.password_required if password is empty - $this->assertEquals([E::PASSWORD_REQUIRED, []], $this->callProtected($model, 'validateValue', '')); + $this->assertSame([E::PASSWORD_REQUIRED, []], $this->callProtected($model, 'validateValue', '')); // Get error.password_incorrect if password is incorrect - $this->assertEquals([E::PASSWORD_INCORRECT, []], $this->callProtected($model, 'validateValue', '87654321')); + $this->assertSame([E::PASSWORD_INCORRECT, []], $this->callProtected($model, 'validateValue', '87654321')); // No errors, if password is correct for provided account $this->assertNull($this->callProtected($model, 'validateValue', '12345678')); diff --git a/api/tests/unit/validators/TotpValidatorTest.php b/api/tests/unit/validators/TotpValidatorTest.php index b234892..6baf9e5 100644 --- a/api/tests/unit/validators/TotpValidatorTest.php +++ b/api/tests/unit/validators/TotpValidatorTest.php @@ -19,13 +19,13 @@ class TotpValidatorTest extends TestCase { $validator = new TotpValidator(['account' => $account]); $result = $this->callProtected($validator, 'validateValue', 123456); - $this->assertEquals([E::TOTP_INCORRECT, []], $result); + $this->assertSame([E::TOTP_INCORRECT, []], $result); $result = $this->callProtected($validator, 'validateValue', $controlTotp->now()); $this->assertNull($result); $result = $this->callProtected($validator, 'validateValue', $controlTotp->at(time() - 31)); - $this->assertEquals([E::TOTP_INCORRECT, []], $result); + $this->assertSame([E::TOTP_INCORRECT, []], $result); $validator->window = 2; $result = $this->callProtected($validator, 'validateValue', $controlTotp->at(time() - 31)); @@ -34,7 +34,7 @@ class TotpValidatorTest extends TestCase { $at = time() - 400; $validator->timestamp = $at; $result = $this->callProtected($validator, 'validateValue', $controlTotp->now()); - $this->assertEquals([E::TOTP_INCORRECT, []], $result); + $this->assertSame([E::TOTP_INCORRECT, []], $result); $result = $this->callProtected($validator, 'validateValue', $controlTotp->at($at)); $this->assertNull($result); diff --git a/api/web/index.php b/api/web/index.php index 306baf5..e6e45e4 100644 --- a/api/web/index.php +++ b/api/web/index.php @@ -8,8 +8,8 @@ $time = microtime(true); require __DIR__ . '/../../vendor/autoload.php'; -defined('YII_DEBUG') or define('YII_DEBUG', in_array(getenv('YII_DEBUG'), ['true', '1'])); -defined('YII_ENV') or define('YII_ENV', getenv('YII_ENV')); +defined('YII_DEBUG') || define('YII_DEBUG', in_array(getenv('YII_DEBUG'), ['true', '1'])); +defined('YII_ENV') || define('YII_ENV', getenv('YII_ENV')); // Initialize an application aspect container AspectKernel::getInstance()->init([ diff --git a/common/behaviors/PrimaryKeyValueBehavior.php b/common/behaviors/PrimaryKeyValueBehavior.php index 0882f20..20889a5 100644 --- a/common/behaviors/PrimaryKeyValueBehavior.php +++ b/common/behaviors/PrimaryKeyValueBehavior.php @@ -18,7 +18,7 @@ class PrimaryKeyValueBehavior extends Behavior { */ public $value; - public function events() { + public function events(): array { return [ ActiveRecord::EVENT_BEFORE_INSERT => 'setPrimaryKeyValue', ]; @@ -32,7 +32,7 @@ class PrimaryKeyValueBehavior extends Behavior { return true; } - public function refreshPrimaryKeyValue() { + public function refreshPrimaryKeyValue(): void { do { $key = $this->generateValue(); } while ($this->isValueExists($key)); @@ -45,15 +45,18 @@ class PrimaryKeyValueBehavior extends Behavior { } protected function isValueExists(string $key): bool { - return $this->owner->find()->andWhere([$this->getPrimaryKeyName() => $key])->exists(); + $owner = $this->owner; + return $owner::find()->andWhere([$this->getPrimaryKeyName() => $key])->exists(); } protected function getPrimaryKeyName(): string { $owner = $this->owner; - $primaryKeys = $owner->primaryKey(); + $primaryKeys = $owner::primaryKey(); if (!isset($primaryKeys[0])) { throw new InvalidConfigException('"' . get_class($owner) . '" must have a primary key.'); - } elseif (count($primaryKeys) > 1) { + } + + if (count($primaryKeys) > 1) { throw new InvalidConfigException('Current behavior don\'t support models with more then one primary key.'); } diff --git a/common/components/Mojang/Api.php b/common/components/Mojang/Api.php index cb92122..37a65a1 100644 --- a/common/components/Mojang/Api.php +++ b/common/components/Mojang/Api.php @@ -26,7 +26,9 @@ class Api { $response = $this->getClient()->get($this->buildUsernameToUUIDRoute($username), $query); if ($response->getStatusCode() === 204) { throw new NoContentException('Username not found'); - } elseif ($response->getStatusCode() !== 200) { + } + + if ($response->getStatusCode() !== 200) { throw new MojangApiException('Unexpected request result'); } diff --git a/common/models/UsernameHistory.php b/common/models/UsernameHistory.php index bba421b..8ffc061 100644 --- a/common/models/UsernameHistory.php +++ b/common/models/UsernameHistory.php @@ -45,7 +45,7 @@ class UsernameHistory extends ActiveRecord { * @param int $afterTime * @return UsernameHistory|null */ - public function findNext(int $afterTime = null): ?UsernameHistory { + public function findNext(int $afterTime = null): ?self { return self::find() ->andWhere(['account_id' => $this->account_id]) ->andWhere(['>', 'applied_in', $afterTime ?: $this->applied_in]) diff --git a/common/tests/_bootstrap.php b/common/tests/_bootstrap.php index 41318a6..ea96bfa 100644 --- a/common/tests/_bootstrap.php +++ b/common/tests/_bootstrap.php @@ -1,7 +1,7 @@ behaviors['dataBehavior']; $this->callProtected($behavior, 'setKey', 'my-key', 'my-value'); - $this->assertEquals(serialize(['my-key' => 'my-value']), $model->_data); + $this->assertSame(serialize(['my-key' => 'my-value']), $model->_data); } public function testGetKey() { @@ -25,7 +25,7 @@ class DataBehaviorTest extends TestCase { $model->_data = serialize(['some-key' => 'some-value']); /** @var DataBehavior $behavior */ $behavior = $model->behaviors['dataBehavior']; - $this->assertEquals('some-value', $this->callProtected($behavior, 'getKey', 'some-key')); + $this->assertSame('some-value', $this->callProtected($behavior, 'getKey', 'some-key')); } public function testGetData() { diff --git a/common/tests/unit/behaviors/EmailActivationExpirationBehaviorTest.php b/common/tests/unit/behaviors/EmailActivationExpirationBehaviorTest.php index 91ed3b1..b25d142 100644 --- a/common/tests/unit/behaviors/EmailActivationExpirationBehaviorTest.php +++ b/common/tests/unit/behaviors/EmailActivationExpirationBehaviorTest.php @@ -15,7 +15,7 @@ class EmailActivationExpirationBehaviorTest extends TestCase { $behavior = $this->createBehavior(); $time = time(); $behavior->owner->created_at = $time; - $this->assertEquals($time + 10, $this->callProtected($behavior, 'calculateTime', 10)); + $this->assertSame($time + 10, $this->callProtected($behavior, 'calculateTime', 10)); } public function testCompareTime() { diff --git a/common/tests/unit/components/Mojang/ApiTest.php b/common/tests/unit/components/Mojang/ApiTest.php index 62bf1db..b958833 100644 --- a/common/tests/unit/components/Mojang/ApiTest.php +++ b/common/tests/unit/components/Mojang/ApiTest.php @@ -31,8 +31,8 @@ class ApiTest extends TestCase { $this->handler->append(new Response(200, [], '{"id": "7125ba8b1c864508b92bb5c042ccfe2b","name": "KrisJelbring"}')); $response = (new Api())->usernameToUUID('KrisJelbring'); $this->assertInstanceOf(UsernameToUUIDResponse::class, $response); - $this->assertEquals('7125ba8b1c864508b92bb5c042ccfe2b', $response->id); - $this->assertEquals('KrisJelbring', $response->name); + $this->assertSame('7125ba8b1c864508b92bb5c042ccfe2b', $response->id); + $this->assertSame('KrisJelbring', $response->name); } /** diff --git a/common/tests/unit/db/mysql/QueryBuilderTest.php b/common/tests/unit/db/mysql/QueryBuilderTest.php index d6505ec..6a8a635 100644 --- a/common/tests/unit/db/mysql/QueryBuilderTest.php +++ b/common/tests/unit/db/mysql/QueryBuilderTest.php @@ -10,7 +10,7 @@ class QueryBuilderTest extends TestCase { public function testBuildOrderByField() { $queryBuilder = new QueryBuilder(Yii::$app->db); $result = $queryBuilder->buildOrderBy(['dummy' => ['first', 'second']]); - $this->assertEquals("ORDER BY FIELD(`dummy`,'first','second')", $result); + $this->assertSame("ORDER BY FIELD(`dummy`,'first','second')", $result); } } diff --git a/common/tests/unit/emails/TemplateTest.php b/common/tests/unit/emails/TemplateTest.php index e3bdeb1..b563fa4 100644 --- a/common/tests/unit/emails/TemplateTest.php +++ b/common/tests/unit/emails/TemplateTest.php @@ -14,7 +14,7 @@ class TemplateTest extends TestCase { public function testConstructor() { /** @var Template|\Mockery\MockInterface $template */ $template = mock(Template::class, ['find-me'])->makePartial(); - $this->assertEquals('find-me', $template->getTo()); + $this->assertSame('find-me', $template->getTo()); $this->assertInstanceOf(MailerInterface::class, $template->getMailer()); } @@ -22,13 +22,13 @@ class TemplateTest extends TestCase { Yii::$app->params['fromEmail'] = 'find-me'; /** @var Template|\Mockery\MockInterface $template */ $template = mock(Template::class)->makePartial(); - $this->assertEquals(['find-me' => 'Ely.by Accounts'], $template->getFrom()); + $this->assertSame(['find-me' => 'Ely.by Accounts'], $template->getFrom()); } public function testGetParams() { /** @var Template|\Mockery\MockInterface $template */ $template = mock(Template::class)->makePartial(); - $this->assertEquals([], $template->getParams()); + $this->assertSame([], $template->getParams()); } public function testCreateMessage() { @@ -39,9 +39,9 @@ class TemplateTest extends TestCase { /** @var MessageInterface $message */ $message = $this->callProtected($template, 'createMessage'); $this->assertInstanceOf(MessageInterface::class, $message); - $this->assertEquals(['to@ely.by' => 'To'], $message->getTo()); - $this->assertEquals(['from@ely.by' => 'Ely.by Accounts'], $message->getFrom()); - $this->assertEquals('mock-subject', $message->getSubject()); + $this->assertSame(['to@ely.by' => 'To'], $message->getTo()); + $this->assertSame(['from@ely.by' => 'Ely.by Accounts'], $message->getFrom()); + $this->assertSame('mock-subject', $message->getSubject()); } } diff --git a/common/tests/unit/emails/TemplateWithRendererTest.php b/common/tests/unit/emails/TemplateWithRendererTest.php index 0ed2971..08e2aa5 100644 --- a/common/tests/unit/emails/TemplateWithRendererTest.php +++ b/common/tests/unit/emails/TemplateWithRendererTest.php @@ -15,8 +15,8 @@ class TemplateWithRendererTest extends TestCase { public function testConstructor() { /** @var TemplateWithRenderer|\Mockery\MockInterface $template */ $template = mock(TemplateWithRenderer::class, ['mock-to', 'mock-locale'])->makePartial(); - $this->assertEquals('mock-to', $template->getTo()); - $this->assertEquals('mock-locale', $template->getLocale()); + $this->assertSame('mock-to', $template->getTo()); + $this->assertSame('mock-locale', $template->getLocale()); $this->assertInstanceOf(MailerInterface::class, $template->getMailer()); $this->assertInstanceOf(EmailRenderer::class, $template->getEmailRenderer()); } @@ -40,10 +40,10 @@ class TemplateWithRendererTest extends TestCase { /** @var \yii\swiftmailer\Message $message */ $message = $this->callProtected($template, 'createMessage'); $this->assertInstanceOf(MessageInterface::class, $message); - $this->assertEquals(['to@ely.by' => 'To'], $message->getTo()); - $this->assertEquals(['from@ely.by' => 'From'], $message->getFrom()); - $this->assertEquals('mock-subject', $message->getSubject()); - $this->assertEquals('mock-html', $message->getSwiftMessage()->getBody()); + $this->assertSame(['to@ely.by' => 'To'], $message->getTo()); + $this->assertSame(['from@ely.by' => 'From'], $message->getFrom()); + $this->assertSame('mock-subject', $message->getSubject()); + $this->assertSame('mock-html', $message->getSwiftMessage()->getBody()); } } diff --git a/common/tests/unit/helpers/StringHelperTest.php b/common/tests/unit/helpers/StringHelperTest.php index 56a2035..4d9a84f 100644 --- a/common/tests/unit/helpers/StringHelperTest.php +++ b/common/tests/unit/helpers/StringHelperTest.php @@ -7,11 +7,11 @@ use common\tests\unit\TestCase; class StringHelperTest extends TestCase { public function testGetEmailMask() { - $this->assertEquals('**@ely.by', StringHelper::getEmailMask('e@ely.by')); - $this->assertEquals('e**@ely.by', StringHelper::getEmailMask('es@ely.by')); - $this->assertEquals('e**i@ely.by', StringHelper::getEmailMask('eri@ely.by')); - $this->assertEquals('er**ch@ely.by', StringHelper::getEmailMask('erickskrauch@ely.by')); - $this->assertEquals('эр**уч@елу.бел', StringHelper::getEmailMask('эрикскрауч@елу.бел')); + $this->assertSame('**@ely.by', StringHelper::getEmailMask('e@ely.by')); + $this->assertSame('e**@ely.by', StringHelper::getEmailMask('es@ely.by')); + $this->assertSame('e**i@ely.by', StringHelper::getEmailMask('eri@ely.by')); + $this->assertSame('er**ch@ely.by', StringHelper::getEmailMask('erickskrauch@ely.by')); + $this->assertSame('эр**уч@елу.бел', StringHelper::getEmailMask('эрикскрауч@елу.бел')); } public function testIsUuid() { @@ -25,7 +25,7 @@ class StringHelperTest extends TestCase { */ public function testTrim($expected, $string) { $result = StringHelper::trim($string); - $this->assertEquals($expected, $result); + $this->assertSame($expected, $result); } /** diff --git a/common/tests/unit/models/AccountSessionTest.php b/common/tests/unit/models/AccountSessionTest.php index ca429f1..46b8a6c 100644 --- a/common/tests/unit/models/AccountSessionTest.php +++ b/common/tests/unit/models/AccountSessionTest.php @@ -15,13 +15,13 @@ class AccountSessionTest extends TestCase { public function testSetIp() { $model = new AccountSession(); $model->setIp('127.0.0.1'); - $this->assertEquals(2130706433, $model->last_used_ip, 'method should convert passed ip string to long'); + $this->assertSame(2130706433, $model->last_used_ip, 'method should convert passed ip string to long'); } public function testGetReadableIp() { $model = new AccountSession(); $model->last_used_ip = 2130706433; - $this->assertEquals('127.0.0.1', $model->getReadableIp(), 'method should convert stored long into readable ip'); + $this->assertSame('127.0.0.1', $model->getReadableIp(), 'method should convert stored long into readable ip'); } } diff --git a/common/tests/unit/models/AccountTest.php b/common/tests/unit/models/AccountTest.php index fe0b7ae..0f8a31e 100644 --- a/common/tests/unit/models/AccountTest.php +++ b/common/tests/unit/models/AccountTest.php @@ -23,7 +23,7 @@ class AccountTest extends TestCase { $model->setPassword('12345678'); $this->assertNotEmpty($model->password_hash, 'hash should be set'); $this->assertTrue($model->validatePassword('12345678'), 'validation should be passed'); - $this->assertEquals(Account::PASS_HASH_STRATEGY_YII2, $model->password_hash_strategy, 'latest password hash should be used'); + $this->assertSame(Account::PASS_HASH_STRATEGY_YII2, $model->password_hash_strategy, 'latest password hash should be used'); } public function testValidatePassword() { @@ -83,7 +83,7 @@ class AccountTest extends TestCase { public function testGetProfileLink() { $model = new Account(); $model->id = '123'; - $this->assertEquals('http://ely.by/u123', $model->getProfileLink()); + $this->assertSame('http://ely.by/u123', $model->getProfileLink()); } public function testIsAgreedWithActualRules() { @@ -108,9 +108,9 @@ class AccountTest extends TestCase { public function testSetRegistrationIp() { $account = new Account(); $account->setRegistrationIp('42.72.205.204'); - $this->assertEquals('42.72.205.204', inet_ntop($account->registration_ip)); + $this->assertSame('42.72.205.204', inet_ntop($account->registration_ip)); $account->setRegistrationIp('2001:1620:28:1:b6f:8bca:93:a116'); - $this->assertEquals('2001:1620:28:1:b6f:8bca:93:a116', inet_ntop($account->registration_ip)); + $this->assertSame('2001:1620:28:1:b6f:8bca:93:a116', inet_ntop($account->registration_ip)); $account->setRegistrationIp(null); $this->assertNull($account->registration_ip); } @@ -118,9 +118,9 @@ class AccountTest extends TestCase { public function testGetRegistrationIp() { $account = new Account(); $account->setRegistrationIp('42.72.205.204'); - $this->assertEquals('42.72.205.204', $account->getRegistrationIp()); + $this->assertSame('42.72.205.204', $account->getRegistrationIp()); $account->setRegistrationIp('2001:1620:28:1:b6f:8bca:93:a116'); - $this->assertEquals('2001:1620:28:1:b6f:8bca:93:a116', $account->getRegistrationIp()); + $this->assertSame('2001:1620:28:1:b6f:8bca:93:a116', $account->getRegistrationIp()); $account->setRegistrationIp(null); $this->assertNull($account->getRegistrationIp()); } diff --git a/common/tests/unit/tasks/ClearOauthSessionsTest.php b/common/tests/unit/tasks/ClearOauthSessionsTest.php index 25835bc..1f3ac8f 100644 --- a/common/tests/unit/tasks/ClearOauthSessionsTest.php +++ b/common/tests/unit/tasks/ClearOauthSessionsTest.php @@ -29,7 +29,7 @@ class ClearOauthSessionsTest extends TestCase { $result = ClearOauthSessions::createFromOauthClient($client, time()); $this->assertInstanceOf(ClearOauthSessions::class, $result); $this->assertSame('mocked-id', $result->clientId); - $this->assertEquals(time(), $result->notSince, '', 1); + $this->assertEqualsWithDelta(time(), $result->notSince, 1); } public function testExecute() { diff --git a/common/tests/unit/tasks/DeliveryWebHookTest.php b/common/tests/unit/tasks/DeliveryWebHookTest.php index 1a002f9..e2f980e 100644 --- a/common/tests/unit/tasks/DeliveryWebHookTest.php +++ b/common/tests/unit/tasks/DeliveryWebHookTest.php @@ -53,7 +53,7 @@ class DeliveryWebHookTest extends TestCase { $this->assertSame('account.edit', $request->getHeaders()['X-Ely-Accounts-Event'][0]); $this->assertSame('application/x-www-form-urlencoded', $request->getHeaders()['Content-Type'][0]); $this->assertArrayNotHasKey('X-Hub-Signature', $request->getHeaders()); - $this->assertEquals('key=value&another=value', (string)$request->getBody()); + $this->assertSame('key=value&another=value', (string)$request->getBody()); } public function testExecuteSuccessDeliveryWithSignature() { @@ -74,7 +74,7 @@ class DeliveryWebHookTest extends TestCase { $this->assertSame('account.edit', $request->getHeaders()['X-Ely-Accounts-Event'][0]); $this->assertSame('application/x-www-form-urlencoded', $request->getHeaders()['Content-Type'][0]); $this->assertSame('sha1=3c0b1eef564b2d3a5e9c0f2a8302b1b42b3d4784', $request->getHeaders()['X-Hub-Signature'][0]); - $this->assertEquals('key=value&another=value', (string)$request->getBody()); + $this->assertSame('key=value&another=value', (string)$request->getBody()); } public function testExecuteHandleClientException() { diff --git a/common/tests/unit/tasks/PullMojangUsernameTest.php b/common/tests/unit/tasks/PullMojangUsernameTest.php index 1fdfce3..df97827 100644 --- a/common/tests/unit/tasks/PullMojangUsernameTest.php +++ b/common/tests/unit/tasks/PullMojangUsernameTest.php @@ -142,7 +142,7 @@ class PullMojangUsernameTest extends TestCase { /** @var MojangUsername|null $mojangUsername */ $mojangUsername = MojangUsername::findOne($username); $this->assertInstanceOf(MojangUsername::class, $mojangUsername); - $this->assertNotEquals($mojangInfo->uuid, $mojangUsername->uuid); + $this->assertNotSame($mojangInfo->uuid, $mojangUsername->uuid); } } diff --git a/common/tests/unit/validators/EmailValidatorTest.php b/common/tests/unit/validators/EmailValidatorTest.php index b9f985e..711c2d8 100644 --- a/common/tests/unit/validators/EmailValidatorTest.php +++ b/common/tests/unit/validators/EmailValidatorTest.php @@ -26,18 +26,18 @@ class EmailValidatorTest extends TestCase { $model = $this->createModel("testemail@ely.by\u{feff}"); // Zero width no-break space (U+FEFF) $this->validator->validateAttribute($model, 'field'); - $this->assertEquals(['error.email_invalid'], $model->getErrors('field')); - $this->assertEquals('testemail@ely.by', $model->field); + $this->assertSame(['error.email_invalid'], $model->getErrors('field')); + $this->assertSame('testemail@ely.by', $model->field); } public function testValidateAttributeRequired() { $model = $this->createModel(''); $this->validator->validateAttribute($model, 'field'); - $this->assertEquals(['error.email_required'], $model->getErrors('field')); + $this->assertSame(['error.email_required'], $model->getErrors('field')); $model = $this->createModel('email'); $this->validator->validateAttribute($model, 'field'); - $this->assertNotEquals(['error.email_required'], $model->getErrors('field')); + $this->assertNotSame(['error.email_required'], $model->getErrors('field')); } public function testValidateAttributeLength() { @@ -49,11 +49,11 @@ class EmailValidatorTest extends TestCase { '@gmail.com' // = 256 symbols ); $this->validator->validateAttribute($model, 'field'); - $this->assertEquals(['error.email_too_long'], $model->getErrors('field')); + $this->assertSame(['error.email_too_long'], $model->getErrors('field')); $model = $this->createModel('some-email@gmail.com'); $this->validator->validateAttribute($model, 'field'); - $this->assertNotEquals(['error.email_too_long'], $model->getErrors('field')); + $this->assertNotSame(['error.email_too_long'], $model->getErrors('field')); } public function testValidateAttributeEmail() { @@ -61,15 +61,15 @@ class EmailValidatorTest extends TestCase { $model = $this->createModel('non-email'); $this->validator->validateAttribute($model, 'field'); - $this->assertEquals(['error.email_invalid'], $model->getErrors('field')); + $this->assertSame(['error.email_invalid'], $model->getErrors('field')); $model = $this->createModel('non-email@etot-domen-ne-suschestrvyet.de'); $this->validator->validateAttribute($model, 'field'); - $this->assertEquals(['error.email_invalid'], $model->getErrors('field')); + $this->assertSame(['error.email_invalid'], $model->getErrors('field')); $model = $this->createModel('valid-email@gmail.com'); $this->validator->validateAttribute($model, 'field'); - $this->assertNotEquals(['error.email_invalid'], $model->getErrors('field')); + $this->assertNotSame(['error.email_invalid'], $model->getErrors('field')); } public function testValidateAttributeTempmail() { @@ -77,11 +77,11 @@ class EmailValidatorTest extends TestCase { $model = $this->createModel('ibrpycwyjdnt@dropmail.me'); $this->validator->validateAttribute($model, 'field'); - $this->assertEquals(['error.email_is_tempmail'], $model->getErrors('field')); + $this->assertSame(['error.email_is_tempmail'], $model->getErrors('field')); $model = $this->createModel('valid-email@gmail.com'); $this->validator->validateAttribute($model, 'field'); - $this->assertNotEquals(['error.email_is_tempmail'], $model->getErrors('field')); + $this->assertNotSame(['error.email_is_tempmail'], $model->getErrors('field')); } public function testValidateAttributeIdna() { @@ -108,19 +108,19 @@ class EmailValidatorTest extends TestCase { $model = $this->createModel($accountFixture->email); $this->validator->validateAttribute($model, 'field'); - $this->assertEquals(['error.email_not_available'], $model->getErrors('field')); + $this->assertSame(['error.email_not_available'], $model->getErrors('field')); $model = $this->createModel($accountFixture->email); $this->validator->accountCallback = function() use ($accountFixture) { return $accountFixture->id; }; $this->validator->validateAttribute($model, 'field'); - $this->assertNotEquals(['error.email_not_available'], $model->getErrors('field')); + $this->assertNotSame(['error.email_not_available'], $model->getErrors('field')); $this->validator->accountCallback = null; $model = $this->createModel('some-unique-email@gmail.com'); $this->validator->validateAttribute($model, 'field'); - $this->assertNotEquals(['error.email_not_available'], $model->getErrors('field')); + $this->assertNotSame(['error.email_not_available'], $model->getErrors('field')); } /** diff --git a/common/tests/unit/validators/MinecraftServerAddressValidatorTest.php b/common/tests/unit/validators/MinecraftServerAddressValidatorTest.php index 914dd3b..a0acdc7 100644 --- a/common/tests/unit/validators/MinecraftServerAddressValidatorTest.php +++ b/common/tests/unit/validators/MinecraftServerAddressValidatorTest.php @@ -11,18 +11,23 @@ class MinecraftServerAddressValidatorTest extends TestCase { */ public function testValidate($address, $shouldBeValid) { $validator = new MinecraftServerAddressValidator(); + $validator->message = 'mock message'; $validator->validate($address, $errors); - $this->assertEquals($shouldBeValid, $errors === null); + if ($shouldBeValid) { + $this->assertNull($errors); + } else { + $this->assertSame('mock message', $errors); + } } public function domainNames() { return [ - ['localhost', true ], - ['localhost:25565', true ], - ['mc.hypixel.net', true ], - ['mc.hypixel.net:25565', true ], - ['136.243.88.97', true ], - ['136.243.88.97:25565', true ], + ['localhost', true], + ['localhost:25565', true], + ['mc.hypixel.net', true], + ['mc.hypixel.net:25565', true], + ['136.243.88.97', true], + ['136.243.88.97:25565', true], ['http://ely.by', false], ['http://ely.by:80', false], ['ely.by/abcd', false], diff --git a/common/tests/unit/validators/UsernameValidatorTest.php b/common/tests/unit/validators/UsernameValidatorTest.php index 7328943..0a32634 100644 --- a/common/tests/unit/validators/UsernameValidatorTest.php +++ b/common/tests/unit/validators/UsernameValidatorTest.php @@ -21,33 +21,33 @@ class UsernameValidatorTest extends TestCase { public function testValidateTrimming() { $model = $this->createModel("HereIsJohnny#\u{feff}"); // Zero width no-break space (U+FEFF) $this->validator->validateAttribute($model, 'field'); - $this->assertEquals(['error.username_invalid'], $model->getErrors('field')); - $this->assertEquals('HereIsJohnny#', $model->field); + $this->assertSame(['error.username_invalid'], $model->getErrors('field')); + $this->assertSame('HereIsJohnny#', $model->field); } public function testValidateAttributeRequired() { $model = $this->createModel(''); $this->validator->validateAttribute($model, 'field'); - $this->assertEquals(['error.username_required'], $model->getErrors('field')); + $this->assertSame(['error.username_required'], $model->getErrors('field')); $model = $this->createModel('username'); $this->validator->validateAttribute($model, 'field'); - $this->assertNotEquals(['error.username_required'], $model->getErrors('field')); + $this->assertNotSame(['error.username_required'], $model->getErrors('field')); } public function testValidateAttributeLength() { $model = $this->createModel('at'); $this->validator->validateAttribute($model, 'field'); - $this->assertEquals(['error.username_too_short'], $model->getErrors('field')); + $this->assertSame(['error.username_too_short'], $model->getErrors('field')); $model = $this->createModel('erickskrauch_erickskrauch'); $this->validator->validateAttribute($model, 'field'); - $this->assertEquals(['error.username_too_long'], $model->getErrors('field')); + $this->assertSame(['error.username_too_long'], $model->getErrors('field')); $model = $this->createModel('username'); $this->validator->validateAttribute($model, 'field'); - $this->assertNotEquals(['error.username_too_short'], $model->getErrors('field')); - $this->assertNotEquals(['error.username_too_long'], $model->getErrors('field')); + $this->assertNotSame(['error.username_too_short'], $model->getErrors('field')); + $this->assertNotSame(['error.username_too_long'], $model->getErrors('field')); } // TODO: rewrite this test with @provider usage @@ -59,7 +59,7 @@ class UsernameValidatorTest extends TestCase { foreach ($shouldBeValid as $nickname) { $model = $this->createModel($nickname); $this->validator->validateAttribute($model, 'field'); - $this->assertNotEquals(['error.username_invalid'], $model->getErrors('field')); + $this->assertNotSame(['error.username_invalid'], $model->getErrors('field')); } $shouldBeInvalid = [ @@ -68,7 +68,7 @@ class UsernameValidatorTest extends TestCase { foreach ($shouldBeInvalid as $nickname) { $model = $this->createModel($nickname); $this->validator->validateAttribute($model, 'field'); - $this->assertEquals(['error.username_invalid'], $model->getErrors('field')); + $this->assertSame(['error.username_invalid'], $model->getErrors('field')); } } @@ -82,19 +82,19 @@ class UsernameValidatorTest extends TestCase { $model = $this->createModel($accountFixture->username); $this->validator->validateAttribute($model, 'field'); - $this->assertEquals(['error.username_not_available'], $model->getErrors('field')); + $this->assertSame(['error.username_not_available'], $model->getErrors('field')); $model = $this->createModel($accountFixture->username); $this->validator->accountCallback = function() use ($accountFixture) { return $accountFixture->id; }; $this->validator->validateAttribute($model, 'field'); - $this->assertNotEquals(['error.username_not_available'], $model->getErrors('field')); + $this->assertNotSame(['error.username_not_available'], $model->getErrors('field')); $this->validator->accountCallback = null; $model = $this->createModel('some-unique-username'); $this->validator->validateAttribute($model, 'field'); - $this->assertNotEquals(['error.username_not_available'], $model->getErrors('field')); + $this->assertNotSame(['error.username_not_available'], $model->getErrors('field')); } /** diff --git a/common/tests/unit/validators/UuidValidatorTest.php b/common/tests/unit/validators/UuidValidatorTest.php index d45cc19..191af72 100644 --- a/common/tests/unit/validators/UuidValidatorTest.php +++ b/common/tests/unit/validators/UuidValidatorTest.php @@ -16,7 +16,7 @@ class UuidValidatorTest extends TestCase { $model = $this->createModel(); $validator->validateAttribute($model, 'attribute'); $this->assertTrue($model->hasErrors()); - $this->assertEquals(['Attribute must be valid uuid'], $model->getErrors('attribute')); + $this->assertSame(['Attribute must be valid uuid'], $model->getErrors('attribute')); }); $this->specify('expected error if passed invalid string', function() { @@ -25,7 +25,7 @@ class UuidValidatorTest extends TestCase { $model->attribute = '123456789'; $validator->validateAttribute($model, 'attribute'); $this->assertTrue($model->hasErrors()); - $this->assertEquals(['Attribute must be valid uuid'], $model->getErrors('attribute')); + $this->assertSame(['Attribute must be valid uuid'], $model->getErrors('attribute')); }); $this->specify('no errors if passed nil uuid and allowNil is set to true', function() { @@ -43,7 +43,7 @@ class UuidValidatorTest extends TestCase { $model->attribute = '00000000-0000-0000-0000-000000000000'; $validator->validateAttribute($model, 'attribute'); $this->assertTrue($model->hasErrors()); - $this->assertEquals(['Attribute must be valid uuid'], $model->getErrors('attribute')); + $this->assertSame(['Attribute must be valid uuid'], $model->getErrors('attribute')); }); $this->specify('no errors if passed valid uuid', function() { @@ -61,7 +61,7 @@ class UuidValidatorTest extends TestCase { $model->attribute = str_replace('-', '', $originalUuid); $validator->validateAttribute($model, 'attribute'); $this->assertFalse($model->hasErrors()); - $this->assertEquals($originalUuid, $model->attribute); + $this->assertSame($originalUuid, $model->attribute); }); } diff --git a/composer.json b/composer.json index 9f4e12a..c69b94e 100644 --- a/composer.json +++ b/composer.json @@ -7,6 +7,7 @@ "require": { "php": "^7.2", "ext-json": "*", + "ext-mbstring": "*", "ext-pdo": "*", "ext-libxml": "*", "ext-simplexml": "*", @@ -37,7 +38,7 @@ "codeception/verify": "*", "mockery/mockery": "^1.0.0", "php-mock/php-mock-mockery": "^1.2.0", - "ely/php-code-style": "^0.1.0", + "ely/php-code-style": "^0.3.0", "predis/predis": "^1.1", "roave/security-advisories": "dev-master" }, diff --git a/composer.lock b/composer.lock index c989311..b6118c3 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "c0a5d0472eaecefbba5199888a4232ae", + "content-hash": "edb3d935ad36f30c49f8a4db6132747a", "packages": [ { "name": "bacon/bacon-qr-code", @@ -118,8 +118,7 @@ "dist": { "type": "zip", "url": "https://api.github.com/repos/RobinHerbots/Inputmask/zipball/5e670ad62f50c738388d4dcec78d2888505ad77b", - "reference": "5e670ad62f50c738388d4dcec78d2888505ad77b", - "shasum": null + "reference": "5e670ad62f50c738388d4dcec78d2888505ad77b" }, "require": { "bower-asset/jquery": ">=1.7" @@ -140,8 +139,7 @@ "dist": { "type": "zip", "url": "https://api.github.com/repos/jquery/jquery-dist/zipball/77d2a51d0520d2ee44173afdf4e40a9201f5964e", - "reference": "77d2a51d0520d2ee44173afdf4e40a9201f5964e", - "shasum": null + "reference": "77d2a51d0520d2ee44173afdf4e40a9201f5964e" }, "type": "bower-asset", "license": [ @@ -159,8 +157,7 @@ "dist": { "type": "zip", "url": "https://api.github.com/repos/bestiejs/punycode.js/zipball/38c8d3131a82567bfef18da09f7f4db68c84f8a3", - "reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3", - "shasum": null + "reference": "38c8d3131a82567bfef18da09f7f4db68c84f8a3" }, "type": "bower-asset" }, @@ -175,8 +172,7 @@ "dist": { "type": "zip", "url": "https://api.github.com/repos/getsentry/raven-js-bower/zipball/c8b3a6040be6928e2f57fa5eec4d7afc31750235", - "reference": "c8b3a6040be6928e2f57fa5eec4d7afc31750235", - "shasum": null + "reference": "c8b3a6040be6928e2f57fa5eec4d7afc31750235" }, "type": "bower-asset" }, @@ -191,8 +187,7 @@ "dist": { "type": "zip", "url": "https://api.github.com/repos/yiisoft/jquery-pjax/zipball/aef7b953107264f00234902a3880eb50dafc48be", - "reference": "aef7b953107264f00234902a3880eb50dafc48be", - "shasum": null + "reference": "aef7b953107264f00234902a3880eb50dafc48be" }, "require": { "bower-asset/jquery": ">=1.8" @@ -2398,8 +2393,7 @@ "dist": { "type": "zip", "url": "https://api.github.com/repos/twbs/bootstrap/zipball/68b0d231a13201eb14acd3dc84e51543d16e5f7e", - "reference": "68b0d231a13201eb14acd3dc84e51543d16e5f7e", - "shasum": null + "reference": "68b0d231a13201eb14acd3dc84e51543d16e5f7e" }, "require": { "bower-asset/jquery": ">=1.9.1,<4.0" @@ -2814,24 +2808,24 @@ }, { "name": "ely/php-code-style", - "version": "0.1.0", + "version": "0.3.0", "source": { "type": "git", "url": "https://github.com/elyby/php-code-style.git", - "reference": "0bb3e8082753981af4775f5b95d159c9cd9c6bf4" + "reference": "2140798d0aca85f4fa3e70c77bfef066ce115d1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/elyby/php-code-style/zipball/0bb3e8082753981af4775f5b95d159c9cd9c6bf4", - "reference": "0bb3e8082753981af4775f5b95d159c9cd9c6bf4", + "url": "https://api.github.com/repos/elyby/php-code-style/zipball/2140798d0aca85f4fa3e70c77bfef066ce115d1a", + "reference": "2140798d0aca85f4fa3e70c77bfef066ce115d1a", "shasum": "" }, "require": { - "friendsofphp/php-cs-fixer": "^2.11", + "friendsofphp/php-cs-fixer": "^2.13.0", "php": "^7.0" }, "require-dev": { - "phpunit/phpunit": "^7.0" + "phpunit/phpunit": "^6.5.1" }, "type": "library", "autoload": { @@ -2859,7 +2853,7 @@ "Code style", "php-cs-fixer" ], - "time": "2018-04-17T18:28:51+00:00" + "time": "2019-02-23T17:29:08+00:00" }, { "name": "facebook/webdriver", @@ -2964,27 +2958,27 @@ }, { "name": "friendsofphp/php-cs-fixer", - "version": "v2.12.2", + "version": "v2.14.2", "source": { "type": "git", "url": "https://github.com/FriendsOfPHP/PHP-CS-Fixer.git", - "reference": "dcc87d5414e9d0bd316fce81a5bedb9ce720b183" + "reference": "ff401e58261ffc5934a58f795b3f95b355e276cb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/dcc87d5414e9d0bd316fce81a5bedb9ce720b183", - "reference": "dcc87d5414e9d0bd316fce81a5bedb9ce720b183", + "url": "https://api.github.com/repos/FriendsOfPHP/PHP-CS-Fixer/zipball/ff401e58261ffc5934a58f795b3f95b355e276cb", + "reference": "ff401e58261ffc5934a58f795b3f95b355e276cb", "shasum": "" }, "require": { "composer/semver": "^1.4", - "composer/xdebug-handler": "^1.0", + "composer/xdebug-handler": "^1.2", "doctrine/annotations": "^1.2", "ext-json": "*", "ext-tokenizer": "*", - "php": "^5.6 || >=7.0 <7.3", + "php": "^5.6 || ^7.0", "php-cs-fixer/diff": "^1.3", - "symfony/console": "^3.2 || ^4.0", + "symfony/console": "^3.4.17 || ^4.1.6", "symfony/event-dispatcher": "^3.0 || ^4.0", "symfony/filesystem": "^3.0 || ^4.0", "symfony/finder": "^3.0 || ^4.0", @@ -2994,13 +2988,10 @@ "symfony/process": "^3.0 || ^4.0", "symfony/stopwatch": "^3.0 || ^4.0" }, - "conflict": { - "hhvm": "*" - }, "require-dev": { "johnkary/phpunit-speedtrap": "^1.1 || ^2.0 || ^3.0", "justinrainbow/json-schema": "^5.0", - "keradus/cli-executor": "^1.1", + "keradus/cli-executor": "^1.2", "mikey179/vfsstream": "^1.6", "php-coveralls/php-coveralls": "^2.1", "php-cs-fixer/accessible-object": "^1.0", @@ -3051,7 +3042,7 @@ } ], "description": "A tool to automatically fix PHP code style", - "time": "2018-07-06T10:37:40+00:00" + "time": "2019-02-17T17:44:13+00:00" }, { "name": "fzaninotto/faker", @@ -5876,6 +5867,7 @@ "platform": { "php": "^7.2", "ext-json": "*", + "ext-mbstring": "*", "ext-pdo": "*", "ext-libxml": "*", "ext-simplexml": "*" diff --git a/console/migrations/m171222_200114_migrate_to_utf8md4_unicode_ci.php b/console/migrations/m171222_200114_migrate_to_utf8md4_unicode_ci.php index 0fef2b7..3d007be 100644 --- a/console/migrations/m171222_200114_migrate_to_utf8md4_unicode_ci.php +++ b/console/migrations/m171222_200114_migrate_to_utf8md4_unicode_ci.php @@ -8,10 +8,10 @@ class m171222_200114_migrate_to_utf8md4_unicode_ci extends Migration { $this->execute('SET FOREIGN_KEY_CHECKS=0'); $dbName = $this->db->createCommand('SELECT DATABASE()')->queryScalar(); - $this->execute("ALTER DATABASE {{%$dbName}} CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci"); + $this->execute("ALTER DATABASE {{%{$dbName}}} CHARACTER SET = utf8mb4 COLLATE = utf8mb4_unicode_ci"); $tables = $this->db->createCommand('SHOW TABLES')->queryColumn(); foreach ($tables as $table) { - $this->execute("ALTER TABLE {{%$table}} CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"); + $this->execute("ALTER TABLE {{%{$table}}} CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci"); } $this->execute('ALTER TABLE {{%usernames_history}} MODIFY username VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_bin NOT NULL'); @@ -23,10 +23,10 @@ class m171222_200114_migrate_to_utf8md4_unicode_ci extends Migration { $this->execute('SET FOREIGN_KEY_CHECKS=0'); $dbName = $this->db->createCommand('SELECT DATABASE()')->queryScalar(); - $this->execute("ALTER DATABASE {{%$dbName}} CHARACTER SET = utf8 COLLATE = utf8_general_ci"); + $this->execute("ALTER DATABASE {{%{$dbName}}} CHARACTER SET = utf8 COLLATE = utf8_general_ci"); $tables = $this->db->createCommand('SHOW TABLES')->queryColumn(); foreach ($tables as $table) { - $this->execute("ALTER TABLE {{%$table}} CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci"); + $this->execute("ALTER TABLE {{%{$table}}} CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci"); } $this->execute('ALTER TABLE {{%usernames_history}} MODIFY username VARCHAR(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL'); diff --git a/console/tests/_bootstrap.php b/console/tests/_bootstrap.php index 156889d..e919416 100644 --- a/console/tests/_bootstrap.php +++ b/console/tests/_bootstrap.php @@ -1,8 +1,8 @@ tester->grabFixture('emailActivations', 'deeplyExpiredConfirmation'); $controller = new CleanupController('cleanup', Yii::$app); - $this->assertEquals(0, $controller->actionEmailKeys()); + $this->assertSame(0, $controller->actionEmailKeys()); $this->tester->cantSeeRecord(EmailActivation::class, ['key' => $expiredConfirmation->key]); } @@ -40,7 +40,7 @@ class CleanupControllerTest extends TestCase { $expiredSession = $this->tester->grabFixture('minecraftSessions', 'expired-token'); $controller = new CleanupController('cleanup', Yii::$app); - $this->assertEquals(0, $controller->actionMinecraftSessions()); + $this->assertSame(0, $controller->actionMinecraftSessions()); $this->tester->cantSeeRecord(MinecraftAccessKey::class, ['access_token' => $expiredSession->access_token]); } @@ -53,11 +53,11 @@ class CleanupControllerTest extends TestCase { $totalSessionsCount = AccountSession::find()->count(); $controller = new CleanupController('cleanup', Yii::$app); - $this->assertEquals(0, $controller->actionWebSessions()); + $this->assertSame(0, $controller->actionWebSessions()); $this->tester->cantSeeRecord(AccountSession::class, ['id' => $expiredSession->id]); $this->tester->cantSeeRecord(AccountSession::class, ['id' => $notRefreshedSession->id]); - $this->assertEquals($totalSessionsCount - 2, AccountSession::find()->count()); + $this->assertSame($totalSessionsCount - 2, (int)AccountSession::find()->count()); } public function testActionOauthClients() { @@ -65,11 +65,11 @@ class CleanupControllerTest extends TestCase { $totalClientsCount = OauthClient::find()->includeDeleted()->count(); $controller = new CleanupController('cleanup', Yii::$app); - $this->assertEquals(0, $controller->actionOauthClients()); + $this->assertSame(0, $controller->actionOauthClients()); $this->assertNull(OauthClient::find()->includeDeleted()->andWhere(['id' => 'deleted-oauth-client'])->one()); $this->assertNotNull(OauthClient::find()->includeDeleted()->andWhere(['id' => 'deleted-oauth-client-with-sessions'])->one()); - $this->assertEquals($totalClientsCount - 1, OauthClient::find()->includeDeleted()->count()); + $this->assertSame($totalClientsCount - 1, (int)OauthClient::find()->includeDeleted()->count()); /** @var ClearOauthSessions $job */ $job = $this->tester->grabLastQueuedJob(); diff --git a/yii b/yii index 20610d6..0a9e27c 100755 --- a/yii +++ b/yii @@ -2,8 +2,8 @@