Skip to content
Snippets Groups Projects

\Drupal::state()-get()/set() to Drupal::keyValue()->get()/set()

Closed spokje requested to merge issue/drupal-3496319:3496319-random-test-failure into 11.x
1 unresolved thread
Files
5
@@ -45,7 +45,7 @@ public function testCommentPreview(): void {
// Test escaping of the username on the preview form.
\Drupal::service('module_installer')->install(['user_hooks_test']);
\Drupal::state()->set('user_hooks_test_user_format_name_alter', TRUE);
\Drupal::keyValue('user_hooks_test')->set('user_format_name_alter', TRUE);
$edit = [];
$edit['subject[0][value]'] = $this->randomMachineName(8);
$edit['comment_body[0][value]'] = $this->randomMachineName(16);
@@ -53,7 +53,7 @@ public function testCommentPreview(): void {
$this->submitForm($edit, 'Preview');
$this->assertSession()->assertEscaped('<em>' . $this->webUser->id() . '</em>');
\Drupal::state()->set('user_hooks_test_user_format_name_alter_safe', TRUE);
\Drupal::keyValue('user_hooks_test')->set('user_format_name_alter_safe', TRUE);
$this->drupalGet('node/' . $this->node->id());
$this->submitForm($edit, 'Preview');
$this->assertInstanceOf(MarkupInterface::class, $this->webUser->getDisplayName());
Loading