mirror of
https://github.com/elyby/accounts.git
synced 2024-10-30 23:43:00 +05:30
29 lines
892 B
PHP
29 lines
892 B
PHP
<?php
|
|
namespace codeception\console\unit\controllers;
|
|
|
|
use common\models\EmailActivation;
|
|
use console\controllers\CleanupController;
|
|
use tests\codeception\common\fixtures\EmailActivationFixture;
|
|
use tests\codeception\console\unit\TestCase;
|
|
use Yii;
|
|
|
|
class CleanupControllerTest extends TestCase {
|
|
|
|
public function _fixtures() {
|
|
return [
|
|
'emailActivations' => EmailActivationFixture::class,
|
|
];
|
|
}
|
|
|
|
public function testActionAccessTokens() {
|
|
/** @var EmailActivation $expiredConfirmation */
|
|
$expiredConfirmation = $this->tester->grabFixture('emailActivations', 'deeplyExpiredConfirmation');
|
|
|
|
$controller = new CleanupController('cleanup', Yii::$app);
|
|
$this->assertEquals(0, $controller->actionEmailKeys());
|
|
|
|
$this->tester->cantSeeRecord(EmailActivation::className(), ['key' => $expiredConfirmation->key]);
|
|
}
|
|
|
|
}
|