ContactPage.php 461 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

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