ContactPage.php 1.1 KB
Newer Older
Mark committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
<?php

namespace tests\functional\_pages;

class ContactPage extends \tests\_pages\ContactPage
{
	/**
	 * contact form name text field locator
	 * @var string 
	 */
	public $name = 'ContactForm[name]';
	/**
	 * contact form email text field locator
	 * @var string
	 */
	public $email = 'ContactForm[email]';
	/**
	 * contact form subject text field locator
	 * @var string
	 */
	public $subject = 'ContactForm[subject]';
	/**
	 * contact form body textarea locator
	 * @var string
	 */
	public $body = 'ContactForm[body]';
	/**
	 * contact form verification code text field locator
	 * @var string
	 */
	public $verifyCode = 'ContactForm[verifyCode]';

	/**
	 * 
	 * @param array $contactData
	 */
	public function submit(array $contactData)
	{
39 40 41 42
		if (empty($contactData)) {
			$this->guy->submitForm('#contact-form', []);
		} else {
			$this->guy->submitForm('#contact-form', [
Mark committed
43 44 45 46 47 48
				$this->name			=>	$contactData['name'],
				$this->email		=>	$contactData['email'],
				$this->subject		=>	$contactData['subject'],
				$this->body			=>	$contactData['body'],
				$this->verifyCode	=>	$contactData['verifyCode'],
			]);
49
		}
Mark committed
50 51
	}
}