You are here

protected function BasicAuthTestTrait::basicAuthPostForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/basic_auth/src/Tests/BasicAuthTestTrait.php \Drupal\basic_auth\Tests\BasicAuthTestTrait::basicAuthPostForm()

Executes a form submission using basic authentication.

Parameters

string $path: Location of the post form.

array $edit: Field data in an associative array.

string $submit: Value of the submit button whose click is to be emulated.

string $username: The username to use for basic authentication.

string $password: The password to use for basic authentication.

array $options: Options to be forwarded to the url generator.

string $form_html_id: (optional) HTML ID of the form to be submitted.

string $extra_post: (optional) A string of additional data to append to the POST submission.

Return value

string The retrieved HTML string.

See also

\Drupal\simpletest\WebTestBase::drupalPostForm()

File

core/modules/basic_auth/src/Tests/BasicAuthTestTrait.php, line 59
Contains \Drupal\basic_auth\Tests\BasicAuthTestTrait.

Class

BasicAuthTestTrait
Provides common functionality for Basic Authentication test classes.

Namespace

Drupal\basic_auth\Tests

Code

protected function basicAuthPostForm($path, $edit, $submit, $username, $password, array $options = array(), $form_html_id = NULL, $extra_post = NULL) {
  return $this
    ->drupalPostForm($path, $edit, $submit, $options, $this
    ->getBasicAuthHeaders($username, $password), $form_html_id, $extra_post);
}