X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcontent_moderation%2Ftests%2Fsrc%2FFunctional%2FModerationStateTestBase.php;fp=web%2Fcore%2Fmodules%2Fcontent_moderation%2Ftests%2Fsrc%2FFunctional%2FModerationStateTestBase.php;h=9d12c174496d5198f9b075295dbb86ef9977ad5a;hp=712732f9f61923dfff52940ad6a901fbf36810fd;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/content_moderation/tests/src/Functional/ModerationStateTestBase.php b/web/core/modules/content_moderation/tests/src/Functional/ModerationStateTestBase.php index 712732f9f..9d12c1744 100644 --- a/web/core/modules/content_moderation/tests/src/Functional/ModerationStateTestBase.php +++ b/web/core/modules/content_moderation/tests/src/Functional/ModerationStateTestBase.php @@ -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); }