You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UserProfilePage.php 700B

1 jaar geleden
1234567891011121314151617181920212223242526
  1. <?php
  2. namespace tests\codeception\frontend\_pages;
  3. use tests\codeception\common\_pages\MyBasePage;
  4. /**
  5. * Represents contact page
  6. * @property \codeception_frontend\AcceptanceTester|\codeception_frontend\FunctionalTester $actor
  7. */
  8. class UserProfilePage extends MyBasePage
  9. {
  10. public $route = 'user/update';
  11. /**
  12. * @param array $contactData
  13. */
  14. public function submit(array $contactData)
  15. {
  16. foreach ($contactData as $field => $value) {
  17. $inputType = $field === 'address' ? 'textarea' : 'input';
  18. $this->actor->fillField($inputType . '[name="User[' . $field . ']"]', $value);
  19. }
  20. $this->actor->click('user-profile-button');
  21. }
  22. }