Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / content_moderation / tests / src / Functional / ModerationStateTestBase.php
index 712732f9f61923dfff52940ad6a901fbf36810fd..9d12c174496d5198f9b075295dbb86ef9977ad5a 100644 (file)
@@ -3,7 +3,9 @@
 namespace Drupal\Tests\content_moderation\Functional;
 
 use Drupal\Core\Session\AccountInterface;
+use Drupal\node\Entity\NodeType;
 use Drupal\Tests\BrowserTestBase;
+use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
 use Drupal\user\Entity\Role;
 
 /**
@@ -11,6 +13,8 @@ use Drupal\user\Entity\Role;
  */
 abstract class ModerationStateTestBase extends BrowserTestBase {
 
+  use ContentModerationTestTrait;
+
   /**
    * Profile to use.
    *
@@ -45,6 +49,13 @@ abstract class ModerationStateTestBase extends BrowserTestBase {
     'use editorial transition archived_published',
   ];
 
+  /**
+   * The editorial workflow entity.
+   *
+   * @var \Drupal\workflows\Entity\Workflow
+   */
+  protected $workflow;
+
   /**
    * Modules to enable.
    *
@@ -63,6 +74,7 @@ abstract class ModerationStateTestBase extends BrowserTestBase {
    */
   protected function setUp() {
     parent::setUp();
+    $this->workflow = $this->createEditorialWorkflow();
     $this->adminUser = $this->drupalCreateUser($this->permissions);
     $this->drupalPlaceBlock('local_tasks_block', ['id' => 'tabs_block']);
     $this->drupalPlaceBlock('page_title_block');
@@ -110,6 +122,9 @@ abstract class ModerationStateTestBase extends BrowserTestBase {
     ];
     $this->drupalPostForm(NULL, $edit, t('Save content type'));
 
+    // Check the content type has been set to create new revisions.
+    $this->assertTrue(NodeType::load($content_type_id)->isNewRevision());
+
     if ($moderated) {
       $this->enableModerationThroughUi($content_type_id, $workflow_id);
     }