Implemented account deletion. Not all cases covered with tests [skip ci]

This commit is contained in:
ErickSkrauch
2020-06-12 00:27:02 +03:00
parent c86817a93d
commit 0183e54442
56 changed files with 1041 additions and 188 deletions

View File

@@ -3,7 +3,6 @@ declare(strict_types=1);
namespace common\tests\unit\tasks;
use common\models\Account;
use common\tasks\ClearAccountSessions;
use common\tests\fixtures;
use common\tests\unit\TestCase;
@@ -23,18 +22,10 @@ class ClearAccountSessionsTest extends TestCase {
];
}
public function testCreateFromAccount() {
$account = new Account();
$account->id = 123;
$task = ClearAccountSessions::createFromAccount($account);
$this->assertSame(123, $task->accountId);
}
public function testExecute() {
/** @var \common\models\Account $bannedAccount */
$bannedAccount = $this->tester->grabFixture('accounts', 'banned-account');
$task = new ClearAccountSessions();
$task->accountId = $bannedAccount->id;
$task = new ClearAccountSessions($bannedAccount->id);
$task->execute($this->createMock(Queue::class));
$this->assertEmpty($bannedAccount->sessions);
$this->assertEmpty($bannedAccount->minecraftAccessKeys);