В проект внедрён RabbitMQ.

Контроллер для работы с RabbitMQ научился создавать типизированные аргументы для $body
Добавлена таблица с историей ников
Добавлена таблица Mojang ников
Добавлена проверка активированности аккаунта в AccountsController
This commit is contained in:
ErickSkrauch
2016-04-23 21:44:10 +03:00
parent 067fc1d3d6
commit cba769a1ec
24 changed files with 489 additions and 47 deletions

View File

@@ -1,11 +1,3 @@
# Codeception Test Suite Configuration
# suite for functional (integration) tests.
# emulate web requests and make application process them.
# (tip: better to use with frameworks).
# RUN `build` COMMAND AFTER ADDING/REMOVING MODULES.
#basic/web/index.php
class_name: FunctionalTester
modules:
enabled:
@@ -14,6 +6,7 @@ modules:
- tests\codeception\common\_support\FixtureHelper
- REST
- Redis
- AMQP
config:
Yii2:
configFile: '../config/api/functional.php'
@@ -21,3 +14,10 @@ modules:
host: localhost
port: 6379
database: 1
AMQP:
host: localhost
port: 5672
username: 'ely-accounts-tester'
password: 'tester-password'
vhost: '/account.ely.by/tests'
queues: ['account-operations']

View File

@@ -5,7 +5,6 @@ use Codeception\Scenario;
use Codeception\Specify;
use common\models\Account;
use tests\codeception\api\_pages\AccountsRoute;
use tests\codeception\api\_pages\LoginRoute;
use tests\codeception\api\functional\_steps\AccountSteps;
use tests\codeception\api\FunctionalTester;

View File

@@ -4,6 +4,7 @@ namespace tests\codeception\api\models;
use api\models\ChangeUsernameForm;
use Codeception\Specify;
use common\models\Account;
use common\models\UsernameHistory;
use tests\codeception\api\unit\DbTestCase;
use tests\codeception\common\fixtures\AccountFixture;
use Yii;
@@ -31,9 +32,17 @@ class ChangeUsernameFormTest extends DbTestCase {
]);
expect($model->change())->true();
expect(Account::findOne(1)->username)->equals('my_new_nickname');
expect(UsernameHistory::findOne(['username' => 'my_new_nickname']))->isInstanceOf(UsernameHistory::class);
});
}
public function testCreateTask() {
$model = new DummyChangeUsernameForm();
$model->createTask('1', 'test1', 'test');
// TODO: у меня пока нет идей о том, чтобы это как-то успешно протестировать, увы
// но по крайней мере можно убедиться, что оно не падает где-то на этом шаге
}
}
// TODO: тут образуется магическая переменная 1, что не круто. После перехода на php7 можно заюзать анонимный класс