yii2-netdisk/tests/codeception/_pages/ContactPage.php

27 lines
625 B
PHP
Raw Normal View History

2013-12-02 19:25:21 +08:00
<?php
namespace tests\codeception\_pages;
2013-12-02 19:25:21 +08:00
use yii\codeception\BasePage;
2013-12-02 19:25:21 +08:00
/**
* Represents contact page
* @property \AcceptanceTester|\FunctionalTester $actor
*/
class ContactPage extends BasePage
{
2014-03-16 12:46:16 +08:00
public $route = 'site/contact';
2013-12-02 19:25:21 +08:00
2014-03-16 12:46:16 +08:00
/**
* @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);
2014-03-16 12:46:16 +08:00
}
$this->actor->click('contact-button');
2014-03-16 12:46:16 +08:00
}
2013-12-02 19:25:21 +08:00
}