hasModerationForm example

// Now that all revision translations are published, verify that the     // moderation form is never displayed on revision pages.     /** @var \Drupal\node\NodeStorageInterface $storage */
    $storage = $this->container->get('entity_type.manager')->getStorage('node');
    foreach (range(11, 16) as $revision_id) {
      /** @var \Drupal\node\NodeInterface $revision */
      $revision = $storage->loadRevision($revision_id);
      foreach ($revision->getTranslationLanguages() as $langcode => $language) {
        if ($revision->isRevisionTranslationAffected()) {
          $this->drupalGet($revision->toUrl('revision'));
          $this->assertFalse($this->hasModerationForm(), 'Moderation form is not displayed correctly for revision ' . $revision_id);
          break;
        }
      }
    }

    // Create an Italian draft (revision 7).     $this->drupalGet($translate_path);
    $this->clickLink('Edit', 3);
    $this->submitNodeForm('Test 2.7 IT', 'draft');
    $this->assertLatestVersionPage($it_node2);
    $this->assertNoModerationForm($node2);
    
Home | Imprint | This part of the site doesn't use cookies.