SignupPage.php 522 Bytes
Newer Older
1 2 3 4 5 6 7 8 9
<?php

namespace frontend\tests\_pages;

use \yii\codeception\BasePage;

class SignupPage extends BasePage
{

10
    public $route = 'site/signup';
11

12 13 14 15 16 17 18 19 20 21 22
    /**
     * @param array $signupData
     */
    public function submit(array $signupData)
    {
        foreach ($signupData as $field => $value) {
            $inputType = $field === 'body' ? 'textarea' : 'input';
            $this->guy->fillField($inputType . '[name="SignupForm[' . $field . ']"]', $value);
        }
        $this->guy->click('signup-button');
    }
Mark committed
23
}