Mark 12 роки тому
батько
коміт
5f6a9d4a66
1 змінених файлів з 2 додано та 5 видалено
  1. 2 5
      tests/_pages/ContactPage.php

+ 2 - 5
tests/_pages/ContactPage.php

@@ -14,11 +14,8 @@ class ContactPage extends BasePage
 	public function submit(array $contactData)
 	{
 		foreach ($contactData as $field => $value) {
-			if ($field == 'body') {
-				$this->guy->fillField('textarea[name="ContactForm[' . $field . ']"]', $value);
-			} else {
-				$this->guy->fillField('input[name="ContactForm[' . $field .']"]', $value);				
-			}
+			$inputType = ($field == 'body') ? 'textarea' : 'input';
+			$this->guy->fillField($inputType.'[name="ContactForm[' . $field . ']"]', $value);
 		}
 		$this->guy->click('Submit','#contact-form');
 	}