namespace Drupal\Tests\content_moderation\Functional;
use Drupal\Core\Entity\Entity\EntityFormDisplay;
-use Drupal\workflows\Entity\Workflow;
use Drupal\Core\Url;
/**
'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);
*/
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'));
'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 = [