Initial commit
This commit is contained in:
53
frontend/tests/functional/ResendVerificationEmailCest.php
Normal file
53
frontend/tests/functional/ResendVerificationEmailCest.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\tests\functional;
|
||||
|
||||
use frontend\tests\FunctionalTester;
|
||||
use common\fixtures\UserFixture;
|
||||
|
||||
class ResendVerificationEmailCest
|
||||
{
|
||||
protected $formId = '#resend-verification-email-form';
|
||||
|
||||
|
||||
/**
|
||||
* Load fixtures before db transaction begin
|
||||
* Called in _before()
|
||||
* @see \Codeception\Module\Yii2::_before()
|
||||
* @see \Codeception\Module\Yii2::loadFixtures()
|
||||
* @return array
|
||||
*/
|
||||
public function _fixtures()
|
||||
{
|
||||
return [
|
||||
'user' => [
|
||||
'class' => UserFixture::class,
|
||||
'dataFile' => codecept_data_dir() . 'user.php',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
public function _before(FunctionalTester $I)
|
||||
{
|
||||
$I->amOnRoute('site/resend-verification-email');
|
||||
}
|
||||
|
||||
protected function formParams($email)
|
||||
{
|
||||
return [
|
||||
'ResendVerificationEmailForm[email]' => $email
|
||||
];
|
||||
}
|
||||
|
||||
public function checkPage(FunctionalTester $I)
|
||||
{
|
||||
$I->see('Resend verification email', 'h1');
|
||||
$I->see('Please fill out your email. A verification email will be sent there.');
|
||||
}
|
||||
|
||||
public function checkSendSuccessfully(FunctionalTester $I)
|
||||
{
|
||||
$I->submitForm($this->formId, $this->formParams('test@mail.com'));
|
||||
$I->see('Check your email for further instructions.');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user