Skip to content
Snippets Groups Projects
Commit a251a3d9 authored by Rahul Gupta's avatar Rahul Gupta Committed by Ted Bowman
Browse files

Issue #3295758 by rahul_: The project select should be a require field on the...

Issue #3295758 by rahul_: The project select should be a require field on the automatic_updates_extensions UpdaterForm
parent 015b00ae
No related branches found
No related tags found
No related merge requests found
...@@ -136,6 +136,8 @@ final class UpdaterForm extends FormBase { ...@@ -136,6 +136,8 @@ final class UpdaterForm extends FormBase {
'#options' => $options, '#options' => $options,
'#empty' => $this->t('There are no available updates.'), '#empty' => $this->t('There are no available updates.'),
'#attributes' => ['class' => ['update-recommended']], '#attributes' => ['class' => ['update-recommended']],
'#required' => TRUE,
'#required_error' => t('Please select one or more projects.'),
]; ];
if ($form_state->getUserInput()) { if ($form_state->getUserInput()) {
......
...@@ -163,13 +163,18 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase { ...@@ -163,13 +163,18 @@ class UpdaterFormTest extends AutomaticUpdatesFunctionalTestBase {
$installed_version, $installed_version,
$target_version $target_version
); );
// Submit without selecting a project.
$page->pressButton('Update');
$assert_session = $this->assertSession();
$assert_session->pageTextContains('Please select one or more projects.');
// Submit with a project selected.
$page->checkField('projects[' . $this->updateProject . ']'); $page->checkField('projects[' . $this->updateProject . ']');
$page->pressButton('Update'); $page->pressButton('Update');
$this->checkForMetaRefresh(); $this->checkForMetaRefresh();
$this->assertUpdateStagedTimes(1); $this->assertUpdateStagedTimes(1);
// Confirm that the site was put into maintenance mode if needed. // Confirm that the site was put into maintenance mode if needed.
$this->assertSame($state->get('system.maintenance_mode'), $maintenance_mode_on); $this->assertSame($state->get('system.maintenance_mode'), $maintenance_mode_on);
$assert_session = $this->assertSession();
$possible_update_message = 'Possible database updates were detected in the following extensions; you may be redirected to the database update page in order to complete the update process.'; $possible_update_message = 'Possible database updates were detected in the following extensions; you may be redirected to the database update page in order to complete the update process.';
$assert_session->pageTextContains($possible_update_message); $assert_session->pageTextContains($possible_update_message);
$assert_session->pageTextContainsOnce('System'); $assert_session->pageTextContainsOnce('System');
......
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