mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Добавлен обработчик для события блокировки аккаунта
This commit is contained in:
@ -4,6 +4,7 @@ namespace codeception\console\unit\controllers;
|
||||
use common\components\Mojang\Api;
|
||||
use common\components\Mojang\exceptions\NoContentException;
|
||||
use common\components\Mojang\response\UsernameToUUIDResponse;
|
||||
use common\models\amqp\AccountBanned;
|
||||
use common\models\amqp\UsernameChanged;
|
||||
use common\models\MojangUsername;
|
||||
use console\controllers\AccountQueueController;
|
||||
@ -143,4 +144,22 @@ class AccountQueueControllerTest extends TestCase {
|
||||
$this->assertNotEquals($mojangInfo->uuid, $mojangUsername->uuid);
|
||||
}
|
||||
|
||||
public function testRouteAccountBanned() {
|
||||
/** @var \common\models\Account $bannedAccount */
|
||||
$bannedAccount = $this->tester->grabFixture('accounts', 'banned-account');
|
||||
$this->tester->haveFixtures([
|
||||
'oauthSessions' => \tests\codeception\common\fixtures\OauthSessionFixture::class,
|
||||
'minecraftAccessKeys' => \tests\codeception\common\fixtures\MinecraftAccessKeyFixture::class,
|
||||
'authSessions' => \tests\codeception\common\fixtures\AccountSessionFixture::class,
|
||||
]);
|
||||
|
||||
$body = new AccountBanned();
|
||||
$body->accountId = $bannedAccount->id;
|
||||
|
||||
$this->controller->routeAccountBanned($body);
|
||||
$this->assertEmpty($bannedAccount->sessions);
|
||||
$this->assertEmpty($bannedAccount->minecraftAccessKeys);
|
||||
$this->assertEmpty($bannedAccount->oauthSessions);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user