ContactPage.php 518 Bytes
Newer Older
Mark committed
1 2 3 4
<?php

namespace tests\_pages;

5
use yii\codeception\BasePage;
Mark committed
6

7 8
class ContactPage extends BasePage
{
9
    public $route = 'site/contact';
Mark committed
10

11 12 13 14 15 16 17 18 19 20 21
    /**
     * @param array $contactData
     */
    public function submit(array $contactData)
    {
        foreach ($contactData as $field => $value) {
            $inputType = $field === 'body' ? 'textarea' : 'input';
            $this->guy->fillField($inputType . '[name="ContactForm[' . $field . ']"]', $value);
        }
        $this->guy->click('contact-button');
    }
Mark committed
22
}