You are here

private function BrowserKitDriver::submit in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php \Behat\Mink\Driver\BrowserKitDriver::submit()
2 calls to BrowserKitDriver::submit()
BrowserKitDriver::click in vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php
Clicks button or link located by it's XPath query.
BrowserKitDriver::submitForm in vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php
Submits the form.

File

vendor/behat/mink-browserkit-driver/src/BrowserKitDriver.php, line 674

Class

BrowserKitDriver
Symfony2 BrowserKit driver.

Namespace

Behat\Mink\Driver

Code

private function submit(Form $form) {
  $formId = $this
    ->getFormNodeId($form
    ->getFormNode());
  if (isset($this->forms[$formId])) {
    $this
      ->mergeForms($form, $this->forms[$formId]);
  }

  // remove empty file fields from request
  foreach ($form
    ->getFiles() as $name => $field) {
    if (empty($field['name']) && empty($field['tmp_name'])) {
      $form
        ->remove($name);
    }
  }
  foreach ($form
    ->all() as $field) {

    // Add a fix for https://github.com/symfony/symfony/pull/10733 to support Symfony versions which are not fixed
    if ($field instanceof TextareaFormField && null === $field
      ->getValue()) {
      $field
        ->setValue('');
    }
  }
  $this->client
    ->submit($form);
  $this->forms = array();
}