2016-05-11 01:10:06 +05:30
|
|
|
<?php
|
2019-02-21 01:28:52 +05:30
|
|
|
namespace common\tests\unit\models;
|
2016-05-11 01:10:06 +05:30
|
|
|
|
2016-10-29 05:53:29 +05:30
|
|
|
use common\models\confirmations;
|
2016-05-11 01:10:06 +05:30
|
|
|
use common\models\EmailActivation;
|
2019-02-21 01:28:52 +05:30
|
|
|
use common\tests\fixtures\EmailActivationFixture;
|
|
|
|
use common\tests\unit\TestCase;
|
2016-05-11 01:10:06 +05:30
|
|
|
|
2016-10-29 05:53:29 +05:30
|
|
|
class EmailActivationTest extends TestCase {
|
2016-05-11 01:10:06 +05:30
|
|
|
|
2019-05-14 04:28:29 +05:30
|
|
|
public function _fixtures(): array {
|
2016-05-11 01:10:06 +05:30
|
|
|
return [
|
2016-05-16 04:03:19 +05:30
|
|
|
'emailActivations' => EmailActivationFixture::class,
|
2016-05-11 01:10:06 +05:30
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testInstantiate() {
|
2016-10-29 05:53:29 +05:30
|
|
|
$this->assertInstanceOf(confirmations\RegistrationConfirmation::class, EmailActivation::findOne([
|
|
|
|
'type' => EmailActivation::TYPE_REGISTRATION_EMAIL_CONFIRMATION,
|
|
|
|
]));
|
|
|
|
|
|
|
|
$this->assertInstanceOf(confirmations\ForgotPassword::class, EmailActivation::findOne([
|
|
|
|
'type' => EmailActivation::TYPE_FORGOT_PASSWORD_KEY,
|
|
|
|
]));
|
|
|
|
|
|
|
|
$this->assertInstanceOf(confirmations\CurrentEmailConfirmation::class, EmailActivation::findOne([
|
|
|
|
'type' => EmailActivation::TYPE_CURRENT_EMAIL_CONFIRMATION,
|
|
|
|
]));
|
|
|
|
|
|
|
|
$this->assertInstanceOf(confirmations\NewEmailConfirmation::class, EmailActivation::findOne([
|
|
|
|
'type' => EmailActivation::TYPE_NEW_EMAIL_CONFIRMATION,
|
|
|
|
]));
|
2016-05-11 01:10:06 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
}
|