Updated to Drupal 8.6.4, which is PHP 7.3 friendly. Also updated HTMLaw library....
[yaffs-website] / web / core / modules / content_moderation / tests / src / Functional / ModerationRevisionRevertTest.php
index 703c10ff7930b9d1ed43a36d7193d2a8ea09e3a5..b1ad72045a0c057c1b6144eb4c032448262350f3 100644 (file)
@@ -4,7 +4,7 @@ namespace Drupal\Tests\content_moderation\Functional;
 
 use Drupal\simpletest\ContentTypeCreationTrait;
 use Drupal\Tests\BrowserTestBase;
-use Drupal\workflows\Entity\Workflow;
+use Drupal\Tests\content_moderation\Traits\ContentModerationTestTrait;
 
 /**
  * Test revision revert.
@@ -14,6 +14,7 @@ use Drupal\workflows\Entity\Workflow;
 class ModerationRevisionRevertTest extends BrowserTestBase {
 
   use ContentTypeCreationTrait;
+  use ContentModerationTestTrait;
 
   /**
    * Modules to enable.
@@ -34,10 +35,14 @@ class ModerationRevisionRevertTest extends BrowserTestBase {
     $moderated_bundle = $this->createContentType(['type' => 'moderated_bundle']);
     $moderated_bundle->save();
 
-    $workflow = Workflow::load('editorial');
+    $workflow = $this->createEditorialWorkflow();
     $workflow->getTypePlugin()->addEntityTypeAndBundle('node', 'moderated_bundle');
     $workflow->save();
 
+    /** @var \Drupal\Core\Routing\RouteBuilderInterface $router_builder */
+    $router_builder = $this->container->get('router.builder');
+    $router_builder->rebuildIfNeeded();
+
     $admin = $this->drupalCreateUser([
       'access content overview',
       'administer nodes',