2016-05-11 01:10:06 +05:30
|
|
|
<?php
|
|
|
|
namespace codeception\common\unit\models;
|
|
|
|
|
|
|
|
use Codeception\Specify;
|
2016-05-11 01:58:04 +05:30
|
|
|
use common\models\confirmations\ForgotPassword;
|
2016-05-11 01:10:06 +05:30
|
|
|
use common\models\confirmations\RegistrationConfirmation;
|
|
|
|
use common\models\EmailActivation;
|
|
|
|
use tests\codeception\common\fixtures\EmailActivationFixture;
|
2016-09-19 03:31:19 +05:30
|
|
|
use tests\codeception\common\unit\DbTestCase;
|
2016-05-11 01:10:06 +05:30
|
|
|
|
|
|
|
class EmailActivationTest extends DbTestCase {
|
|
|
|
use Specify;
|
|
|
|
|
|
|
|
public function fixtures() {
|
|
|
|
return [
|
2016-05-16 04:03:19 +05:30
|
|
|
'emailActivations' => EmailActivationFixture::class,
|
2016-05-11 01:10:06 +05:30
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function testInstantiate() {
|
|
|
|
$this->specify('return valid model type', function() {
|
|
|
|
expect(EmailActivation::findOne([
|
|
|
|
'type' => EmailActivation::TYPE_REGISTRATION_EMAIL_CONFIRMATION,
|
|
|
|
]))->isInstanceOf(RegistrationConfirmation::class);
|
|
|
|
expect(EmailActivation::findOne([
|
|
|
|
'type' => EmailActivation::TYPE_FORGOT_PASSWORD_KEY,
|
2016-05-11 01:58:04 +05:30
|
|
|
]))->isInstanceOf(ForgotPassword::class);
|
2016-05-11 01:10:06 +05:30
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|