X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fcontent_moderation%2Ftests%2Fsrc%2FFunctional%2FModerationFormTest.php;fp=web%2Fcore%2Fmodules%2Fcontent_moderation%2Ftests%2Fsrc%2FFunctional%2FModerationFormTest.php;h=9f3c401e632bbd74d23eac4939a67d9042f45924;hp=bb9e92d6ea5409c0f0dde816bdf61b70bcfa0cc2;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php b/web/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php index bb9e92d6e..9f3c401e6 100644 --- a/web/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php +++ b/web/core/modules/content_moderation/tests/src/Functional/ModerationFormTest.php @@ -3,7 +3,6 @@ namespace Drupal\Tests\content_moderation\Functional; use Drupal\Core\Entity\Entity\EntityFormDisplay; -use Drupal\workflows\Entity\Workflow; use Drupal\Core\Url; /** @@ -107,6 +106,10 @@ class ModerationFormTest extends ModerationStateTestBase { 'moderation_state[0][state]' => 'published', ], t('Save')); + // Check widget default value. + $this->drupalGet($edit_path); + $this->assertFieldByName('moderation_state[0][state]', 'published', 'The moderation default value is set correctly.'); + // The published view should not have a moderation form, because it is the // live revision. $this->drupalGet($canonical_path); @@ -153,9 +156,8 @@ class ModerationFormTest extends ModerationStateTestBase { */ public function testNonBundleModerationForm() { $this->drupalLogin($this->rootUser); - $workflow = Workflow::load('editorial'); - $workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test_mulrevpub', 'entity_test_mulrevpub'); - $workflow->save(); + $this->workflow->getTypePlugin()->addEntityTypeAndBundle('entity_test_mulrevpub', 'entity_test_mulrevpub'); + $this->workflow->save(); // Create new moderated content in draft. $this->drupalPostForm('entity_test_mulrevpub/add', ['moderation_state[0][state]' => 'draft'], t('Save')); @@ -469,7 +471,7 @@ class ModerationFormTest extends ModerationStateTestBase { 'edit own moderated_content content', 'use editorial transition create_new_draft', 'use editorial transition publish', - 'use editorial transition archive' + 'use editorial transition archive', ]); $this->drupalLogin($user); $paths = [