Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / content_moderation / tests / src / Kernel / StateFormatterTest.php
index c32123df927c9f028efef0a994f0398ac740b634..6d2b8b6b5774366faa3ff93ee6bb58aa6304f375 100644 (file)
@@ -5,7 +5,7 @@ namespace Drupal\Tests\content_moderation\Kernel;
 use Drupal\Core\Render\RenderContext;
 use Drupal\entity_test\Entity\EntityTestRev;
 use Drupal\KernelTests\KernelTestBase;
-use Drupal\workflows\Entity\Workflow;
+use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
 
 /**
  * Test the state field formatter.
@@ -14,6 +14,8 @@ use Drupal\workflows\Entity\Workflow;
  */
 class StateFormatterTest extends KernelTestBase {
 
+  use ContentModerationTestTrait;
+
   /**
    * Modules to enable.
    *
@@ -36,7 +38,7 @@ class StateFormatterTest extends KernelTestBase {
     $this->installEntitySchema('content_moderation_state');
     $this->installConfig('content_moderation');
 
-    $workflow = Workflow::load('editorial');
+    $workflow = $this->createEditorialWorkflow();
     $workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test_rev', 'entity_test_rev');
     $workflow->save();
   }