diff -u b/core/modules/system/tests/src/Functional/Update/DbUpdatesTrait.php b/core/modules/system/src/Tests/Update/DbUpdatesTrait.php --- b/core/modules/system/tests/src/Functional/Update/DbUpdatesTrait.php +++ b/core/modules/system/src/Tests/Update/DbUpdatesTrait.php @@ -1,6 +1,6 @@ pass_raw = 'drupal'; + $account->passRaw = 'drupal'; $this->drupalLogin($account); // Make sure we can see the access-restricted entity reference field diff -u b/core/modules/system/tests/src/Functional/Update/UpdatePathTestJavaScriptTest.php b/core/modules/system/tests/src/Functional/Update/UpdatePathTestJavaScriptTest.php --- b/core/modules/system/tests/src/Functional/Update/UpdatePathTestJavaScriptTest.php +++ b/core/modules/system/tests/src/Functional/Update/UpdatePathTestJavaScriptTest.php @@ -37,12 +37,12 @@ $scripts = $this->xpath('//script'); $found = FALSE; foreach ($scripts as $script) { - if (!isset($script['src'])) { + if (!$script->getAttribute('src')) { continue; } // Source is a root-relative URL. Transform it to an absolute URL to allow // file_get_contents() to access the file. - $src = preg_replace('#^' . $GLOBALS['base_path'] . '(.*)#i', $GLOBALS['base_url'] . '/' . '${1}', (string) $script['src']); + $src = preg_replace('#^' . $GLOBALS['base_path'] . '(.*)#i', $GLOBALS['base_url'] . '/' . '${1}', $script->getAttribute('src')); $file_content = file_get_contents($src); if (strpos($file_content, 'window.drupalSettings =') !== FALSE) { diff -u b/core/modules/system/tests/src/Functional/Update/UpdatePathWithBrokenRoutingTest.php b/core/modules/system/tests/src/Functional/Update/UpdatePathWithBrokenRoutingTest.php --- b/core/modules/system/tests/src/Functional/Update/UpdatePathWithBrokenRoutingTest.php +++ b/core/modules/system/tests/src/Functional/Update/UpdatePathWithBrokenRoutingTest.php @@ -32,16 +32,6 @@ $this->drupalGet(''); $this->assertResponse(500); - // The exceptions are expected. Do not interpret them as a test failure. - // Not using File API; a potential error must trigger a PHP warning. - unlink(\Drupal::root() . '/' . $this->siteDirectory . '/error.log'); - foreach ($this->assertions as $key => $assertion) { - if (strpos($assertion['message'], 'core/modules/system/tests/modules/update_script_test/src/PathProcessor/BrokenInboundPathProcessor.php') !== FALSE) { - unset($this->assertions[$key]); - $this->deleteAssert($assertion['message_id']); - } - } - $this->runUpdates(); // Remove the simulation of the broken router, and make sure we can get to diff -u b/core/modules/system/tests/src/Functional/Update/UpdatePostUpdateFailingTest.php b/core/modules/system/tests/src/Functional/Update/UpdatePostUpdateFailingTest.php --- b/core/modules/system/tests/src/Functional/Update/UpdatePostUpdateFailingTest.php +++ b/core/modules/system/tests/src/Functional/Update/UpdatePostUpdateFailingTest.php @@ -34,7 +34,7 @@ $this->assertIdentical([], \Drupal::state()->get('post_update_test_execution', [])); $key_value = \Drupal::keyValue('update__post_update'); - $this->assertEqual([], $key_value->get('existing_updates')); + $this->assertEqual([], $key_value->get('existing_updates', [])); } /** diff -u b/core/modules/system/tests/src/Functional/Update/UpdateSchemaTest.php b/core/modules/system/tests/src/Functional/Update/UpdateSchemaTest.php --- b/core/modules/system/tests/src/Functional/Update/UpdateSchemaTest.php +++ b/core/modules/system/tests/src/Functional/Update/UpdateSchemaTest.php @@ -57,6 +57,7 @@ $this->assertRaw('Schema version 8001.'); // Run the update hooks. $this->clickLink(t('Apply pending updates')); + $this->checkForMetaRefresh(); // Ensure schema has changed. $this->assertEqual(drupal_get_installed_schema_version('update_test_schema', TRUE), 8001); diff -u b/core/modules/system/tests/src/Functional/Update/UpdateScriptTest.php b/core/modules/system/tests/src/Functional/Update/UpdateScriptTest.php --- b/core/modules/system/tests/src/Functional/Update/UpdateScriptTest.php +++ b/core/modules/system/tests/src/Functional/Update/UpdateScriptTest.php @@ -119,6 +119,7 @@ $this->assertNoText('This is a requirements warning provided by the update_script_test module.'); $this->clickLink(t('Continue')); $this->clickLink(t('Apply pending updates')); + $this->checkForMetaRefresh(); $this->assertText(t('The update_script_test_update_8001() update was executed successfully.'), 'End of update process was reached.'); // Confirm that all caches were cleared. $this->assertText(t('hook_cache_flush() invoked for update_script_test.module.'), 'Caches were cleared after resolving a requirements warning and applying updates.'); @@ -167,7 +168,7 @@ $this->clickLink(t('Continue')); $this->assertText(t('No pending updates.')); $this->assertNoLink('Administration pages'); - $this->assertNoLinkByHrefInMainRegion('update.php', 0); + $this->assertEmpty($this->xpath('//main//a[contains(@href, :href)]', [':href' => 'update.php'])); $this->clickLink('Front page'); $this->assertResponse(200); @@ -178,7 +179,7 @@ $this->clickLink(t('Continue')); $this->assertText(t('No pending updates.')); $this->assertLink('Administration pages'); - $this->assertNoLinkByHrefInMainRegion('update.php', 1); + $this->assertEmpty($this->xpath('//main//a[contains(@href, :href)]', [':href' => 'update.php'])); $this->clickLink('Administration pages'); $this->assertResponse(200); } @@ -209,10 +210,11 @@ $this->drupalGet($this->updateUrl, ['external' => TRUE]); $this->clickLink(t('Continue')); $this->clickLink(t('Apply pending updates')); + $this->checkForMetaRefresh(); $this->assertText('Updates were attempted.'); $this->assertLink('logged'); $this->assertLink('Administration pages'); - $this->assertNoLinkByHrefInMainRegion('update.php', 1); + $this->assertEmpty($this->xpath('//main//a[contains(@href, :href)]', [':href' => 'update.php'])); $this->clickLink('Administration pages'); $this->assertResponse(200); } @@ -275,10 +277,11 @@ $this->drupalGet($this->updateUrl, ['external' => TRUE]); $this->clickLink(t('Continue')); $this->clickLink(t('Apply pending updates')); + $this->checkForMetaRefresh(); $this->assertText('Updates were attempted.'); $this->assertLink('logged'); $this->assertLink('Administration pages'); - $this->assertNoLinkByHrefInMainRegion('update.php', 1); + $this->assertEmpty($this->xpath('//main//a[contains(@href, :href)]', [':href' => 'update.php'])); $this->clickLink('Administration pages'); $this->assertResponse(200); } @@ -306,6 +309,7 @@ $this->drupalGet($this->updateUrl, ['external' => TRUE]); $this->clickLink(t('Continue')); $this->clickLink(t('Apply pending updates')); + $this->checkForMetaRefresh(); // Verify that updates were completed successfully. $this->assertText('Updates were attempted.'); @@ -318,7 +322,7 @@ // Verify that there are no links to different parts of the workflow. $this->assertNoLink('Administration pages'); - $this->assertNoLinkByHrefInMainRegion('update.php', 0); + $this->assertEmpty($this->xpath('//main//a[contains(@href, :href)]', [':href' => 'update.php'])); $this->assertNoLink('logged'); // Verify the front page can be visited following the upgrade. diff -u b/core/tests/Drupal/Tests/BrowserTestBase.php b/core/tests/Drupal/Tests/BrowserTestBase.php --- b/core/tests/Drupal/Tests/BrowserTestBase.php +++ b/core/tests/Drupal/Tests/BrowserTestBase.php @@ -277,7 +277,7 @@ /** * {@inheritdoc} */ - public function __construct($name = NULL, array $data = array(), $dataName = '') { + public function __construct($name = NULL, array $data = [], $dataName = '') { parent::__construct($name, $data, $dataName); $this->root = dirname(dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__))));