/
pashko
/
siec
Обзор
Документация
Войти
/
pashko
/
siec
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
frontend/tests/functional/SignupCest.php
59 строк
2 KB
pash lenovo
files all
10 окт 2019, 13:36
10 окт 2019, 13:36
448df97
Код
Авторство
О чём код?
<?php namespace frontend\tests\functional; use frontend\tests\FunctionalTester; class SignupCest { protected $formId = '#form-signup'; public function _before(FunctionalTester $I) { $I->amOnRoute('site/signup'); } public function signupWithEmptyFields(FunctionalTester $I) { $I->see('Signup', 'h1'); $I->see('Please fill out the following fields to signup:'); $I->submitForm($this->formId, []); $I->seeValidationError('Username cannot be blank.'); $I->seeValidationError('Email cannot be blank.'); $I->seeValidationError('Password cannot be blank.'); } public function signupWithWrongEmail(FunctionalTester $I) { $I->submitForm( $this->formId, [ 'SignupForm[username]' => 'tester', 'SignupForm[email]' => 'ttttt', 'SignupForm[password]' => 'tester_password', ] ); $I->dontSee('Username cannot be blank.', '.help-block'); $I->dontSee('Password cannot be blank.', '.help-block'); $I->see('Email is not a valid email address.', '.help-block'); } public function signupSuccessfully(FunctionalTester $I) { $I->submitForm($this->formId, [ 'SignupForm[username]' => 'tester', 'SignupForm[email]' => 'tester.email@example.com', 'SignupForm[password]' => 'tester_password', ]); $I->seeRecord('common\models\User', [ 'username' => 'tester', 'email' => 'tester.email@example.com', 'status' => \common\models\User::STATUS_INACTIVE ]); $I->seeEmailIsSent(); $I->see('Thank you for registration. Please check your inbox for verification email.'); } }