ContactPage.php 527 Bytes
Newer Older
1 2 3 4 5 6 7 8
<?php

namespace frontend\tests\_pages;

use yii\codeception\BasePage;

class ContactPage extends BasePage
{
9
    public $route = 'site/contact';
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
}