diff --git a/core/lib/Drupal/Core/Database/Database.php b/core/lib/Drupal/Core/Database/Database.php index 89d3727..718e008 100644 --- a/core/lib/Drupal/Core/Database/Database.php +++ b/core/lib/Drupal/Core/Database/Database.php @@ -496,7 +496,7 @@ public static function convertDbUrlToConnectionInfo($url, $root) { * Gets database connection info as a URL. * * @param string $key - * The database connection key. + * (Optional) The database connection key. * * @return string * The connection info as a URL. diff --git a/core/modules/simpletest/src/BrowserTestBase.php b/core/modules/simpletest/src/BrowserTestBase.php index 9702078..4af335a 100644 --- a/core/modules/simpletest/src/BrowserTestBase.php +++ b/core/modules/simpletest/src/BrowserTestBase.php @@ -125,14 +125,14 @@ protected $container; /** - * The config importer that can used in a test. + * The config importer that can be used in a test. * * @var \Drupal\Core\Config\ConfigImporter */ protected $configImporter; /** - * The random generator. + * The random data generator. * * @var \Drupal\Component\Utility\Random */ @@ -155,7 +155,7 @@ /** * The current user logged in using the Mink controlled browser. * - * @var bool + * @var \Drupal\user\UserInterface */ protected $loggedInUser = FALSE; @@ -188,7 +188,7 @@ protected $mink; /** - * Initializes mink sessions. + * Initializes Mink sessions. */ protected function initMink() { $driver = new GoutteDriver(); @@ -201,7 +201,7 @@ protected function initMink() { } /** - * Registers additional mink sessions. + * Registers additional Mink sessions. * * Tests wishing to use a different driver or change the default driver should * override this method. @@ -246,14 +246,14 @@ protected function setUp() { $_SERVER['SERVER_PORT'] = $port; $_SERVER['SERVER_SOFTWARE'] = NULL; $_SERVER['SERVER_NAME'] = 'localhost'; - $_SERVER['REQUEST_URI'] = $path .'/'; + $_SERVER['REQUEST_URI'] = $path . '/'; $_SERVER['REQUEST_METHOD'] = 'GET'; - $_SERVER['SCRIPT_NAME'] = $path .'/index.php'; - $_SERVER['SCRIPT_FILENAME'] = $path .'/index.php'; - $_SERVER['PHP_SELF'] = $path .'/index.php'; + $_SERVER['SCRIPT_NAME'] = $path . '/index.php'; + $_SERVER['SCRIPT_FILENAME'] = $path . '/index.php'; + $_SERVER['PHP_SELF'] = $path . '/index.php'; $_SERVER['HTTP_USER_AGENT'] = 'Drupal command line'; - // Install drupal test site. + // Install Drupal test site. $this->prepareEnvironment(); $this->installDrupal(); @@ -302,7 +302,7 @@ public static function filePreDeleteCallback($path) { } /** - * Clean up the simpletest environment. + * Clean up the Simpletest environment. */ protected function cleanupEnvironment() { // Remove all prefixed tables. @@ -351,7 +351,7 @@ protected function tearDown() { * (optional) Name of the session. Defaults to the active session. * * @return \Behat\Mink\Session - * The active mink session object. + * The active Mink session object. */ public function getSession($name = NULL) { return $this->mink->getSession($name); @@ -373,8 +373,8 @@ public function assertSession($name = NULL) { /** * Prepare for a request to testing site. * - * The testing site is protected via a SIMPLETEST_USER_AGENT cookie that - * is checked by drupal_valid_test_ua(). + * The testing site is protected via a SIMPLETEST_USER_AGENT cookie that is + * checked by drupal_valid_test_ua(). * * @see drupal_valid_test_ua() */ @@ -577,7 +577,7 @@ protected function getRandomGenerator() { * Generates a unique random string containing letters and numbers. * * Do not use this method when testing unvalidated user input. Instead, use - * \Drupal\simpletest\TestBase::randomString(). + * \Drupal\simpletest\BrowserTestBase::randomString(). * * @param int $length * (optional) Length of random string to generate. @@ -645,7 +645,7 @@ protected function checkPermissions(array $permissions) { } /** - * Logs in a user using the mink controlled browser. + * Logs in a user using the Mink controlled browser. * * If a user is already logged in, then the current user is logged out before * logging in the specified user. @@ -713,7 +713,7 @@ protected function drupalLogout() { } /** - * Fills and submit a form. + * Fills and submits a form. * * @param array $edit * Field data in an associative array. Changes the current input fields @@ -735,7 +735,7 @@ protected function drupalLogout() { * form, which is typically the same thing but with hyphens replacing the * underscores. */ - protected function submitForm($edit, $submit, $form_html_id = NULL) { + protected function submitForm(array $edit, $submit, $form_html_id = NULL) { $assert_session = $this->assertSession(); // Get the form. @@ -792,6 +792,7 @@ protected function getOptions($select, Element $container = NULL) { * * @return mixed * Either a test result or NULL. + * * @throws \PHPUnit_Framework_AssertionFailedError * When exception was thrown inside the test. */ @@ -805,7 +806,7 @@ protected function runTest() { } /** - * Installs drupal into the simpletest site. + * Installs Drupal into the Simpletest site. */ public function installDrupal() { // Define information about the user 1 account. @@ -871,12 +872,12 @@ public function installDrupal() { $this->configDirectories[$type] = $path; } - // After writing settings.php, the installer removes write permissions - // from the site directory. To allow drupal_generate_test_ua() to write - // a file containing the private key for drupal_valid_test_ua(), the site - // directory has to be writable. - // TestBase::restoreEnvironment() will delete the entire site directory. - // Not using File API; a potential error must trigger a PHP warning. + // After writing settings.php, the installer removes write permissions from + // the site directory. To allow drupal_generate_test_ua() to write a file + // containing the private key for drupal_valid_test_ua(), the site directory + // has to be writable. + // TestBase::restoreEnvironment() will delete the entire site directory. Not + // using File API; a potential error must trigger a PHP warning. chmod($directory, 0777); $request = \Drupal::request(); @@ -1005,7 +1006,7 @@ protected function installParameters() { * * The generated database table prefix is used for the Drupal installation * being performed for the test. It is also used by the cookie value of - * SIMPLETEST_USER_AGENT by the mink controlled browser. During early Drupal + * SIMPLETEST_USER_AGENT by the Mink controlled browser. During early Drupal * bootstrap, the cookie is parsed, and if it matches, all database queries * use the database table prefix that has been generated here. * @@ -1185,9 +1186,9 @@ protected function writeSettings(array $settings) { * Rebuilds \Drupal::getContainer(). * * Use this to build a new kernel and service container. For example, when the - * list of enabled modules is changed via the Mink controlled browser, in which - * case the test process still contains an old kernel and service container - * with an old module list. + * list of enabled modules is changed via the Mink controlled browser, in + * which case the test process still contains an old kernel and service + * container with an old module list. * * @see BrowserTestBase::prepareEnvironment() * @see BrowserTestBase::restoreEnvironment() @@ -1249,7 +1250,7 @@ protected function prepareRequestForGenerator($clean_urls = TRUE, $override_serv $this->container->get('request_stack')->push($request); // The request context is normally set by the router_listener from within - // its KernelEvents::REQUEST listener. In the simpletest parent site this + // its KernelEvents::REQUEST listener. In the Simpletest parent site this // event is not fired, therefore it is necessary to updated the request // context manually here. $this->container->get('router.request_context')->fromRequest($request); diff --git a/core/modules/simpletest/src/WebAssert.php b/core/modules/simpletest/src/WebAssert.php index 9f96260..9d88eb6 100644 --- a/core/modules/simpletest/src/WebAssert.php +++ b/core/modules/simpletest/src/WebAssert.php @@ -68,4 +68,5 @@ public function selectExists($select, TraversableElement $container = NULL) { return $node; } + }