2016-01-21 02:44:29 +05:30
|
|
|
<?php
|
2016-03-20 05:03:49 +05:30
|
|
|
namespace tests\codeception\api\models\base;
|
2016-01-21 02:44:29 +05:30
|
|
|
|
2016-03-20 05:03:49 +05:30
|
|
|
use api\models\base\KeyConfirmationForm;
|
2016-01-21 02:44:29 +05:30
|
|
|
use Codeception\Specify;
|
2016-05-12 03:38:40 +05:30
|
|
|
use common\models\EmailActivation;
|
2016-10-29 03:17:31 +05:30
|
|
|
use tests\codeception\api\unit\TestCase;
|
2016-01-21 02:44:29 +05:30
|
|
|
use tests\codeception\common\fixtures\EmailActivationFixture;
|
|
|
|
|
2016-10-29 03:17:31 +05:30
|
|
|
class KeyConfirmationFormTest extends TestCase {
|
2016-01-21 02:44:29 +05:30
|
|
|
use Specify;
|
|
|
|
|
2016-10-29 03:17:31 +05:30
|
|
|
public function _fixtures() {
|
2016-01-21 02:44:29 +05:30
|
|
|
return [
|
2016-05-15 04:03:21 +05:30
|
|
|
'emailActivations' => EmailActivationFixture::class,
|
2016-01-21 02:44:29 +05:30
|
|
|
];
|
|
|
|
}
|
|
|
|
|
2016-05-12 03:38:40 +05:30
|
|
|
public function testGetActivationCodeModel() {
|
2016-10-29 03:17:31 +05:30
|
|
|
$model = new KeyConfirmationForm();
|
|
|
|
$model->key = $this->tester->grabFixture('emailActivations', 'freshRegistrationConfirmation')['key'];
|
|
|
|
$this->assertInstanceOf(EmailActivation::class, $model->getActivationCodeModel());
|
2016-05-12 03:38:40 +05:30
|
|
|
|
2016-10-29 03:17:31 +05:30
|
|
|
$model = new KeyConfirmationForm();
|
|
|
|
$model->key = 'this-is-invalid-key';
|
|
|
|
$this->assertNull($model->getActivationCodeModel());
|
2016-01-21 02:44:29 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
}
|