yii2-netdisk/tests/codeception/_pages/ContactPage.php
2014-08-24 14:14:35 +04:00

27 lines
625 B
PHP

<?php
namespace tests\codeception\_pages;
use yii\codeception\BasePage;
/**
* Represents contact page
* @property \AcceptanceTester|\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');
}
}