SignupPage.php 465 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
<?php

namespace frontend\tests\_pages;

use \yii\codeception\BasePage;

class SignupPage extends BasePage
{

	public $route = 'site/signup';

	/**
	 * @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
}