From 721422b8d646224a8d3a265dabbc63d5f761a48e Mon Sep 17 00:00:00 2001 From: catch Date: Thu, 28 Nov 2019 12:26:48 +0000 Subject: [PATCH] Issue #3092658 by gilesmc, longwave: Remove all @deprecated code in the Basic Auth module --- .../src/Tests/BasicAuthTestTrait.php | 81 ------------------- 1 file changed, 81 deletions(-) delete mode 100644 core/modules/basic_auth/src/Tests/BasicAuthTestTrait.php diff --git a/core/modules/basic_auth/src/Tests/BasicAuthTestTrait.php b/core/modules/basic_auth/src/Tests/BasicAuthTestTrait.php deleted file mode 100644 index bef05bc9c87..00000000000 --- a/core/modules/basic_auth/src/Tests/BasicAuthTestTrait.php +++ /dev/null @@ -1,81 +0,0 @@ -getRawContent(). - */ - protected function basicAuthGet($path, $username, $password, array $options = []) { - return $this->drupalGet($path, $options, $this->getBasicAuthHeaders($username, $password)); - } - - /** - * Executes a form submission using basic authentication. - * - * @param string $path - * Location of the post form. - * @param array $edit - * Field data in an associative array. - * @param string $submit - * Value of the submit button whose click is to be emulated. - * @param string $username - * The username to use for basic authentication. - * @param string $password - * The password to use for basic authentication. - * @param array $options - * Options to be forwarded to the url generator. - * @param string $form_html_id - * (optional) HTML ID of the form to be submitted. - * @param string $extra_post - * (optional) A string of additional data to append to the POST submission. - * - * @return string - * The retrieved HTML string. - * - * @see \Drupal\simpletest\WebTestBase::drupalPostForm() - */ - protected function basicAuthPostForm($path, $edit, $submit, $username, $password, array $options = [], $form_html_id = NULL, $extra_post = NULL) { - return $this->drupalPostForm($path, $edit, $submit, $options, $this->getBasicAuthHeaders($username, $password), $form_html_id, $extra_post); - } - - /** - * Returns HTTP headers that can be used for basic authentication in Curl. - * - * @param string $username - * The username to use for basic authentication. - * @param string $password - * The password to use for basic authentication. - * - * @return array - * An array of raw request headers as used by curl_setopt(). - */ - protected function getBasicAuthHeaders($username, $password) { - // Set up Curl to use basic authentication with the test user's credentials. - return ['Authorization: Basic ' . base64_encode("$username:$password")]; - } - -}