Skip to content
Snippets Groups Projects
Unverified Commit 4c051ef7 authored by Alex Pott's avatar Alex Pott
Browse files

Issue #3521698 by alexpott: Add schema for workflow third party settings and test form properly

parent fe5e8dfb
No related branches found
No related tags found
No related merge requests found
Pipeline #484634 passed
......@@ -13,3 +13,10 @@ entity_usage_updater.plugin.html_link:
convert_to_linkit:
type: boolean
label: 'Convert normal links to LinkIt links'
workflows.workflow.*.third_party.entity_usage_updater:
type: mapping
mapping:
default_unpublished_state:
type: string
label: 'ID of the default unpublished state'
......@@ -82,6 +82,7 @@ final class SettingsForm extends ConfigFormBase {
$form['workflow'][$workflow->id()] = [
'#type' => 'select',
'#options' => $options,
'#default_value' => $workflow->getThirdPartySetting('entity_usage_updater', 'default_unpublished_state'),
'#title' => $this->t('Select default unpublished state for %label workflow', ['%label' => $workflow->label()]),
];
}
......
......@@ -171,6 +171,7 @@ class ContentModerationLinkRemoverFormTest extends ModerationStateTestBase {
->pageTextContains('Created Links remover transition.');
$this->drupalGet('admin/config/content/entity-usage-updater');
$this->assertSame('archived', $this->assertSession()->fieldExists('workflow[editorial]')->getValue());
$this->assertCount(2, $this->assertSession()
->fieldExists('workflow[editorial]')
->findAll('css', 'option'));
......@@ -178,6 +179,7 @@ class ContentModerationLinkRemoverFormTest extends ModerationStateTestBase {
->fieldExists('workflow[editorial]')
->selectOption('links_removed');
$this->assertSession()->buttonExists('Save')->press();
$this->assertSame('links_removed', $this->assertSession()->fieldExists('workflow[editorial]')->getValue());
// Allow the user to use the new transition.
$role_ids = $this->adminUser->getRoles(TRUE);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment