mirror of
https://github.com/elyby/accounts.git
synced 2024-11-15 17:56:30 +05:30
27 lines
661 B
PHP
27 lines
661 B
PHP
<?php
|
|
|
|
namespace tests\codeception\api\_pages;
|
|
|
|
use yii\codeception\BasePage;
|
|
|
|
/**
|
|
* Represents contact page
|
|
* @property \codeception_api\AcceptanceTester|\codeception_api\FunctionalTester $actor
|
|
*/
|
|
class ContactPage extends BasePage
|
|
{
|
|
public $route = 'site/contact';
|
|
|
|
/**
|
|
* @param array $contactData
|
|
*/
|
|
public function submit(array $contactData)
|
|
{
|
|
foreach ($contactData as $field => $value) {
|
|
$inputType = $field === 'body' ? 'textarea' : 'input';
|
|
$this->actor->fillField($inputType . '[name="ContactForm[' . $field . ']"]', $value);
|
|
}
|
|
$this->actor->click('contact-button');
|
|
}
|
|
}
|