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 / ModerationStateWidgetTest.php
index c40e753953f6bc17099a7c4ad55b23ff7a859099..f0949643887d09b1fee4ca9397483f000ab27ac3 100644 (file)
@@ -8,7 +8,7 @@ use Drupal\Core\Form\FormState;
 use Drupal\KernelTests\KernelTestBase;
 use Drupal\node\Entity\Node;
 use Drupal\node\Entity\NodeType;
-use Drupal\workflows\Entity\Workflow;
+use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
 
 /**
  * @coversDefaultClass \Drupal\content_moderation\Plugin\Field\FieldWidget\ModerationStateWidget
@@ -16,6 +16,8 @@ use Drupal\workflows\Entity\Workflow;
  */
 class ModerationStateWidgetTest extends KernelTestBase {
 
+  use ContentModerationTestTrait;
+
   /**
    * Modules to install.
    *
@@ -46,7 +48,7 @@ class ModerationStateWidgetTest extends KernelTestBase {
       'type' => 'unmoderated',
     ])->save();
 
-    $workflow = Workflow::load('editorial');
+    $workflow = $this->createEditorialWorkflow();
     $workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'moderated');
     $workflow->save();
   }