2016-11-24 02:11:33 +05:30
|
|
|
<?php
|
|
|
|
namespace codeception\console\unit\controllers;
|
|
|
|
|
2017-03-07 22:44:54 +05:30
|
|
|
use common\models\EmailActivation;
|
|
|
|
use console\controllers\CleanupController;
|
|
|
|
use tests\codeception\common\fixtures\EmailActivationFixture;
|
2016-11-24 02:11:33 +05:30
|
|
|
use tests\codeception\console\unit\TestCase;
|
2017-03-07 22:44:54 +05:30
|
|
|
use Yii;
|
2016-11-24 02:11:33 +05:30
|
|
|
|
|
|
|
class CleanupControllerTest extends TestCase {
|
|
|
|
|
2017-03-07 22:44:54 +05:30
|
|
|
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]);
|
|
|
|
}
|
|
|
|
|
2016-11-24 02:11:33 +05:30
|
|
|
}
|