Skip to content
Snippets Groups Projects
Commit ff08e719 authored by Adam G-H's avatar Adam G-H Committed by Ted Bowman
Browse files

Issue #3233564 by kunal.sachdev, tedbow, phenaproxima: Add test coverage for...

Issue #3233564 by kunal.sachdev, tedbow, phenaproxima: Add test coverage for using the update form from /admin/reports/updates/automatic-update 
parent 2e0feff8
No related branches found
No related tags found
1 merge request!71Issue #3233564: Add test coverage for using the update form from /admin/reports/updates/automatic-update
...@@ -44,12 +44,12 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -44,12 +44,12 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
} }
/** /**
* Data provider for links to the update form. * Data provider for URLs to the update form.
* *
* @return string[][] * @return string[][]
* Test case parameters. * Test case parameters.
*/ */
public function updateFormLinkProvider() :array { public function providerUpdateFormReferringUrl(): array {
return [ return [
'Modules page' => ['/admin/modules/automatic-update'], 'Modules page' => ['/admin/modules/automatic-update'],
'Reports page' => ['/admin/reports/updates/automatic-update'], 'Reports page' => ['/admin/reports/updates/automatic-update'],
...@@ -62,7 +62,7 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -62,7 +62,7 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
* @return string[][] * @return string[][]
* Test case parameters. * Test case parameters.
*/ */
public function updateFormLinksProvider() :array { public function providerTableLooksCorrect(): array {
return [ return [
'Modules page' => ['modules'], 'Modules page' => ['modules'],
'Reports page' => ['reports'], 'Reports page' => ['reports'],
...@@ -75,16 +75,16 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -75,16 +75,16 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
* @todo Mark this test as skipped if the web server is PHP's built-in, single * @todo Mark this test as skipped if the web server is PHP's built-in, single
* threaded server. * threaded server.
* *
* @param string $update_form_link * @param string $update_form_url
* Update Form link. * The URL of the update form to visit.
* *
* @dataProvider updateFormLinkProvider * @dataProvider providerUpdateFormReferringUrl
*/ */
public function testFormNotDisplayedIfAlreadyCurrent(string $update_form_link): void { public function testFormNotDisplayedIfAlreadyCurrent(string $update_form_url): void {
$this->setCoreVersion('9.8.1'); $this->setCoreVersion('9.8.1');
$this->checkForUpdates(); $this->checkForUpdates();
$this->drupalGet($update_form_link); $this->drupalGet($update_form_url);
$assert_session = $this->assertSession(); $assert_session = $this->assertSession();
$assert_session->statusCodeEquals(200); $assert_session->statusCodeEquals(200);
...@@ -96,9 +96,11 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -96,9 +96,11 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
* Tests that available updates are rendered correctly in a table. * Tests that available updates are rendered correctly in a table.
* *
* @param string $access_page * @param string $access_page
* The page at which the form is accessed. * The page from which the update form should be visited.
* Can be one of 'modules' to visit via the module list, or 'reports' to
* visit via the administrative reports page.
* *
* @dataProvider updateFormLinksProvider * @dataProvider providerTableLooksCorrect
*/ */
public function testTableLooksCorrect(string $access_page): void { public function testTableLooksCorrect(string $access_page): void {
$this->drupalPlaceBlock('local_tasks_block', ['primary' => TRUE]); $this->drupalPlaceBlock('local_tasks_block', ['primary' => TRUE]);
...@@ -215,15 +217,15 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -215,15 +217,15 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
/** /**
* Tests that updating to a different minor version isn't supported. * Tests that updating to a different minor version isn't supported.
* *
* @param string $update_form_link * @param string $update_form_url
* Update Form link. * The URL of the update form to visit.
* *
* @dataProvider updateFormLinkProvider * @dataProvider providerUpdateFormReferringUrl
*/ */
public function testMinorVersionUpdateNotSupported(string $update_form_link): void { public function testMinorVersionUpdateNotSupported(string $update_form_url): void {
$this->setCoreVersion('9.7.1'); $this->setCoreVersion('9.7.1');
$this->drupalGet($update_form_link); $this->drupalGet($update_form_url);
$assert_session = $this->assertSession(); $assert_session = $this->assertSession();
$assert_session->pageTextContainsOnce('Updating from one minor version to another is not supported.'); $assert_session->pageTextContainsOnce('Updating from one minor version to another is not supported.');
......
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