Skip to content
Snippets Groups Projects
Commit b5ddbd53 authored by Yash Rode's avatar Yash Rode Committed by Ted Bowman
Browse files

Issue #3319044 by yash.rode, tedbow: Reactor assertUpdateSuccessful() to get...

Issue #3319044 by yash.rode, tedbow: Reactor assertUpdateSuccessful() to get more meaningful error results
parent 25627ce0
No related branches found
No related tags found
No related merge requests found
...@@ -251,20 +251,6 @@ class CoreUpdateTest extends UpdateTestBase { ...@@ -251,20 +251,6 @@ class CoreUpdateTest extends UpdateTestBase {
* The expected active version of Drupal core. * The expected active version of Drupal core.
*/ */
private function assertUpdateSuccessful(string $expected_version): void { private function assertUpdateSuccessful(string $expected_version): void {
// The update form should not have any available updates.
// @todo Figure out why this assertion fails when the batch processor
// redirects directly to the update form, instead of update.status, when
// updating via the UI.
$this->visit('/admin/modules/update');
$this->getMink()->assertSession()->pageTextContains('No update available');
// The status page should report that we're running the expected version and
// the README and default site configuration files should contain the
// placeholder text written by ::setUpstreamCoreVersion(), even though
// `sites/default` is write-protected.
// @see ::createTestProject()
// @see ::setUpstreamCoreVersion()
$this->assertCoreVersion($expected_version);
$web_root = $this->getWebRoot(); $web_root = $this->getWebRoot();
$placeholder = file_get_contents("$web_root/core/README.txt"); $placeholder = file_get_contents("$web_root/core/README.txt");
$this->assertSame("Placeholder for Drupal core $expected_version.", $placeholder); $this->assertSame("Placeholder for Drupal core $expected_version.", $placeholder);
...@@ -297,6 +283,20 @@ class CoreUpdateTest extends UpdateTestBase { ...@@ -297,6 +283,20 @@ class CoreUpdateTest extends UpdateTestBase {
$this->assertArrayNotHasKey('drupal/core-dev', $info['requires']); $this->assertArrayNotHasKey('drupal/core-dev', $info['requires']);
// ...but it should have been updated in the dev dependencies. // ...but it should have been updated in the dev dependencies.
$this->assertSame($expected_version, $info['devRequires']['drupal/core-dev']); $this->assertSame($expected_version, $info['devRequires']['drupal/core-dev']);
// The update form should not have any available updates.
// @todo Figure out why this assertion fails when the batch processor
// redirects directly to the update form, instead of update.status, when
// updating via the UI.
$this->visit('/admin/modules/update');
$this->getMink()->assertSession()->pageTextContains('No update available');
// The status page should report that we're running the expected version and
// the README and default site configuration files should contain the
// placeholder text written by ::setUpstreamCoreVersion(), even though
// `sites/default` is write-protected.
// @see ::createTestProject()
// @see ::setUpstreamCoreVersion()
$this->assertCoreVersion($expected_version);
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment