SignupPage.php 670 Bytes
Newer Older
1 2
<?php

3
namespace tests\codeception\frontend\_pages;
4 5 6

use \yii\codeception\BasePage;

7 8 9 10
/**
 * Represents signup page
 * @property \codeception_frontend\AcceptanceTester|\codeception_frontend\FunctionalTester $actor
 */
11 12 13
class SignupPage extends BasePage
{

14
    public $route = 'site/signup';
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';
23
            $this->actor->fillField($inputType . '[name="SignupForm[' . $field . ']"]', $value);
24
        }
25
        $this->actor->click('signup-button');
26
    }
Mark committed
27
}