mirror of
https://github.com/elyby/accounts.git
synced 2024-11-15 17:56:30 +05:30
28 lines
655 B
PHP
28 lines
655 B
PHP
<?php
|
|
|
|
namespace tests\codeception\api\_pages;
|
|
|
|
use \yii\codeception\BasePage;
|
|
|
|
/**
|
|
* Represents signup page
|
|
* @property \codeception_api\AcceptanceTester|\codeception_api\FunctionalTester $actor
|
|
*/
|
|
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->actor->fillField($inputType . '[name="SignupForm[' . $field . ']"]', $value);
|
|
}
|
|
$this->actor->click('signup-button');
|
|
}
|
|
}
|