Skip to content

Commit

Permalink
Save DC config using config object
Browse files Browse the repository at this point in the history
Mostly a revert of 7020480.
  • Loading branch information
lkmorlan committed May 9, 2024
1 parent d0146a6 commit 5162b95
Showing 1 changed file with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1105,20 +1105,14 @@ public function test(): void {
'review_needed_message' => 'Review needed. ' . $this->randomString(),
'review_overdue_message' => 'Review overdue. ' . $this->randomString(),
];
// Save messages and review interval in config. This used to be done with
// $this->config(), but that no longer works.
$this->drupalLogin($this->rootUser);
$this->drupalGet('admin/config/data-catalogue');
$edit = [
// Save messages and review interval in config.
$this->config('bc_dc.settings')
// Ensure an item with a 1 month interval will appear as needing review.
'edit-data-set-review-period-alert' => 40,
'edit-review-needed-message' => $review_needed_messages['review_needed_message'],
'edit-review-overdue-message' => $review_needed_messages['review_overdue_message'],
'edit-info-schedule-pre-title' => 'Information schedule pre-title ' . $this->randomString(),
];
$this->submitForm($edit, 'Save configuration');
$this->assertSession()->elementExists('xpath', '//div[@class = "messages-list"]//div[contains(text(), "The configuration options have been saved.")]');
$this->drupalLogin($this->users['Test Data catalogue administrator']);
->set('data_set_review_period_alert', 40)
->set('review_needed_message', $review_needed_messages['review_needed_message'])
->set('review_overdue_message', $review_needed_messages['review_overdue_message'])
->set('info_schedule_pre_title', 'Information schedule pre-title ' . $this->randomString())
->save();

// No "Review needed" message appears.
$this->drupalGet('node/2');
Expand Down

0 comments on commit 5162b95

Please sign in to comment.