summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmil Stjerneman2016-08-23 22:32:59 (GMT)
committerEmil Stjerneman2016-08-23 22:32:59 (GMT)
commit3b8e2a33bf26f944ff2aeddae47fe468ceec919e (patch)
treedd5e2e8cc45c06949a69612ce7786f1d20a50e6f
parentc689cd001eb6b64f89414bd138c7cd94be36cecf (diff)
by anon: Redesigned the matcher settings and refactored the update tests.
-rw-r--r--config/optional/linkit.linkit_profile.default.yml38
-rw-r--r--config/schema/linkit.schema.yml2
-rw-r--r--linkit.install18
-rw-r--r--src/MatcherTokensTrait.php10
-rw-r--r--src/Plugin/Linkit/Matcher/EntityMatcher.php72
-rw-r--r--src/Plugin/Linkit/Matcher/FileMatcher.php10
-rw-r--r--src/Plugin/Linkit/Matcher/NodeMatcher.php10
-rw-r--r--src/Plugin/Linkit/Matcher/TermMatcher.php2
-rw-r--r--src/Plugin/Linkit/Matcher/UserMatcher.php21
-rw-r--r--src/Tests/Update/LinkitUpdate8501.php58
-rw-r--r--src/Tests/Update/LinkitUpdateTest.php38
-rw-r--r--tests/fixtures/update/8501/editor.editor.format_1.yml25
-rw-r--r--tests/fixtures/update/8501/filter.format.format_1.yml17
-rw-r--r--tests/fixtures/update/8501/linkit-update-8501.php66
-rw-r--r--tests/fixtures/update/8501/linkit.linkit_profile.test_profile.yml47
-rw-r--r--tests/fixtures/update/drupal-8.linkit-enabled.standard.php.gz (renamed from tests/fixtures/update/linkit-4-to-5/drupal-8.linkit-enabled.standard.php.gz)bin135141 -> 135141 bytes
-rw-r--r--tests/fixtures/update/editor.editor.format_1.yml (renamed from tests/fixtures/update/linkit-4-to-5/editor.editor.format_1.yml)0
-rw-r--r--tests/fixtures/update/editor.editor.format_2.yml (renamed from tests/fixtures/update/linkit-4-to-5/editor.editor.format_2.yml)0
-rw-r--r--tests/fixtures/update/editor.editor.format_3.yml (renamed from tests/fixtures/update/linkit-4-to-5/editor.editor.format_3.yml)0
-rw-r--r--tests/fixtures/update/filter.format.format_1.yml (renamed from tests/fixtures/update/linkit-4-to-5/filter.format.format_1.yml)0
-rw-r--r--tests/fixtures/update/filter.format.format_2.yml (renamed from tests/fixtures/update/linkit-4-to-5/filter.format.format_2.yml)0
-rw-r--r--tests/fixtures/update/filter.format.format_3.yml (renamed from tests/fixtures/update/linkit-4-to-5/filter.format.format_3.yml)0
-rw-r--r--tests/fixtures/update/linkit-additions.php (renamed from tests/fixtures/update/linkit-4-to-5/linkit-4-to-5.php)4
-rw-r--r--tests/fixtures/update/linkit.linkit_profile.test_profile.yml (renamed from tests/fixtures/update/linkit-4-to-5/linkit.linkit_profile.test_profile.yml)0
24 files changed, 165 insertions, 273 deletions
diff --git a/config/optional/linkit.linkit_profile.default.yml b/config/optional/linkit.linkit_profile.default.yml
index fe06c78..7aa4092 100644
--- a/config/optional/linkit.linkit_profile.default.yml
+++ b/config/optional/linkit.linkit_profile.default.yml
@@ -1,19 +1,19 @@
-langcode: en
-status: true
-dependencies:
- module:
- - node
-id: default
-label: Default
-description: 'A default Linkit profile'
-matchers:
- 556010a3-e317-48b3-b4ed-854c10f4b950:
- uuid: 556010a3-e317-48b3-b4ed-854c10f4b950
- id: 'entity:node'
- weight: 0
- settings:
- result_description: 'by [node:author] | [node:created:medium]'
- bundles: { }
- group_by_bundle: false
- include_unpublished: false
- substitution_type: canonical
+langcode: en
+status: true
+dependencies:
+ module:
+ - node
+id: default
+label: Default
+description: 'A default Linkit profile'
+matchers:
+ 556010a3-e317-48b3-b4ed-854c10f4b950:
+ uuid: 556010a3-e317-48b3-b4ed-854c10f4b950
+ id: 'entity:node'
+ weight: 0
+ settings:
+ metadata: 'by [node:author] | [node:created:medium]'
+ bundles: { }
+ group_by_bundle: false
+ include_unpublished: false
+ substitution_type: canonical
diff --git a/config/schema/linkit.schema.yml b/config/schema/linkit.schema.yml
index 3952576..e6854cf 100644
--- a/config/schema/linkit.schema.yml
+++ b/config/schema/linkit.schema.yml
@@ -34,7 +34,7 @@ linkit.matcher.*:
linkit.matcher.entity:
type: mapping
mapping:
- result_description:
+ metadata:
type: string
bundles:
type: sequence
diff --git a/linkit.install b/linkit.install
index 0b42ea9..29561e2 100644
--- a/linkit.install
+++ b/linkit.install
@@ -153,3 +153,21 @@ function linkit_update_8501() {
$profile->save(TRUE);
}
}
+
+/**
+ * Rename profile property 'result_description' to 'metadata'.
+ */
+function linkit_update_8502() {
+ $config_factory = \Drupal::configFactory();
+ foreach ($config_factory->listAll('linkit.linkit_profile.') as $id) {
+ $profile = $config_factory->getEditable($id);
+
+ foreach ($profile->get('matchers') as $key => $matcher) {
+ $old_value = $profile->get('matchers.' . $key . '.settings.result_description');
+ $profile->set('matchers.' . $key . '.settings.metadata', $old_value);
+ $profile->clear('matchers.' . $key . '.settings.result_description');
+ }
+
+ $profile->save(TRUE);
+ }
+}
diff --git a/src/MatcherTokensTrait.php b/src/MatcherTokensTrait.php
index 28113b6..d17fe56 100644
--- a/src/MatcherTokensTrait.php
+++ b/src/MatcherTokensTrait.php
@@ -18,11 +18,11 @@ trait MatcherTokensTrait {
public function insertTokenList(&$form, array $types = []) {
if (\Drupal::moduleHandler()->moduleExists('token')) {
// Add the token tree UI.
- $form['token_tree'] = [
+ $form['metadata']['token_tree'] = [
'#theme' => 'token_tree_link',
'#token_types' => $types,
'#dialog' => TRUE,
- '#weight' => -90,
+ '#weight' => 10,
];
}
else {
@@ -35,13 +35,13 @@ trait MatcherTokensTrait {
}
if (count($token_items)) {
- $form['tokens'] = [
+ $form['metadata']['tokens'] = [
'#type' => 'details',
'#title' => t('Available tokens'),
- '#weight' => -90,
+ '#weight' => 10,
];
- $form['tokens']['list'] = [
+ $form['metadata']['tokens']['list'] = [
'#theme' => 'item_list',
'#items' => $token_items,
];
diff --git a/src/Plugin/Linkit/Matcher/EntityMatcher.php b/src/Plugin/Linkit/Matcher/EntityMatcher.php
index 812a076..5bfca1e 100644
--- a/src/Plugin/Linkit/Matcher/EntityMatcher.php
+++ b/src/Plugin/Linkit/Matcher/EntityMatcher.php
@@ -133,10 +133,10 @@ class EntityMatcher extends ConfigurableMatcherBase {
$summery = parent::getSummary();
$entity_type = $this->entityTypeManager->getDefinition($this->targetType);
- $result_description = $this->configuration['result_description'];
- if (!empty($result_description)) {
- $summery[] = $this->t('Result description: @result_description', [
- '@result_description' => $result_description,
+ $metadata = $this->configuration['metadata'];
+ if (!empty($metadata)) {
+ $summery[] = $this->t('Metadata: @metadata', [
+ '@metadata' => $metadata,
]);
}
@@ -168,7 +168,7 @@ class EntityMatcher extends ConfigurableMatcherBase {
*/
public function defaultConfiguration() {
return parent::defaultConfiguration() + [
- 'result_description' => '',
+ 'metadata' => '',
'bundles' => [],
'group_by_bundle' => FALSE,
'substitution_type' => SubstitutionManagerInterface::DEFAULT_SUBSTITUTION,
@@ -180,13 +180,22 @@ class EntityMatcher extends ConfigurableMatcherBase {
*/
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$entity_type = $this->entityTypeManager->getDefinition($this->targetType);
- $form['result_description'] = [
- '#title' => $this->t('Result description'),
+
+ $form['metadata'] = array(
+ '#type' => 'details',
+ '#title' => t('Suggestion metadata'),
+ '#open' => TRUE,
+ '#weight' => -100,
+ );
+
+ $form['metadata']['metadata'] = [
+ '#title' => $this->t('Metadata'),
'#type' => 'textfield',
- '#default_value' => $this->configuration['result_description'],
+ '#default_value' => $this->configuration['metadata'],
+ '#description' => $this->t('Metadata is shown together with each suggestion in the suggestion list.'),
'#size' => 120,
'#maxlength' => 255,
- '#weight' => -100,
+ '#weight' => 0,
];
$this->insertTokenList($form, [$this->targetType]);
@@ -198,34 +207,51 @@ class EntityMatcher extends ConfigurableMatcherBase {
$bundle_options[$bundle_name] = $bundle_info['label'];
}
- $form['bundles'] = [
+ $form['bundle_restrictions'] = array(
+ '#type' => 'details',
+ '#title' => t('Bundle restrictions'),
+ '#open' => TRUE,
+ '#weight' => -90,
+ );
+
+ $form['bundle_restrictions']['bundles'] = [
'#type' => 'checkboxes',
- '#title' => $this->t('Restrict to the selected bundles'),
+ '#title' => $this->t('Restrict suggestions to the selected bundles'),
'#options' => $bundle_options,
'#default_value' => $this->configuration['bundles'],
- '#description' => $this->t('If none of the checkboxes is checked, allow all bundles.'),
+ '#description' => $this->t('If none of the checkboxes is checked, all bundles are allowed.'),
'#element_validate' => [[get_class($this), 'elementValidateFilter']],
- '#weight' => -50,
];
- // Group the results by bundle.
- $form['group_by_bundle'] = [
+ $form['bundle_grouping'] = array(
+ '#type' => 'details',
+ '#title' => t('Bundle grouping'),
+ '#open' => TRUE,
+ );
+
+ // Group the suggestions by bundle.
+ $form['bundle_grouping']['group_by_bundle'] = [
'#type' => 'checkbox',
'#title' => $this->t('Group by bundle'),
'#default_value' => $this->configuration['group_by_bundle'],
- '#weight' => -50,
+ '#description' => $this->t('Group suggestions by their bundle.'),
];
}
$substitution_options = $this->substitutionManager->getApplicablePluginsOptionList($this->targetType);
- $form['substitution_type'] = [
+ $form['substitution'] = array(
+ '#type' => 'details',
+ '#title' => t('URL substitution'),
+ '#open' => TRUE,
+ '#weight' => 100,
+ '#access' => count($substitution_options) !== 1,
+ );
+ $form['substitution']['substitution_type'] = [
'#title' => $this->t('Substitution Type'),
'#type' => 'select',
'#default_value' => $this->configuration['substitution_type'],
'#options' => $substitution_options,
'#description' => $this->t('Configure how the selected entity should be transformed into a URL for insertion.'),
- '#weight' => -49,
- '#access' => count($substitution_options) !== 1,
];
return $form;
@@ -241,7 +267,7 @@ class EntityMatcher extends ConfigurableMatcherBase {
* {@inheritdoc}
*/
public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
- $this->configuration['result_description'] = $form_state->getValue('result_description');
+ $this->configuration['metadata'] = $form_state->getValue('metadata');
$this->configuration['bundles'] = $form_state->getValue('bundles');
$this->configuration['group_by_bundle'] = $form_state->getValue('group_by_bundle');
$this->configuration['substitution_type'] = $form_state->getValue('substitution_type');
@@ -343,16 +369,16 @@ class EntityMatcher extends ConfigurableMatcherBase {
}
/**
- * Builds the description string used in the match array.
+ * Builds the metadata string used in the match array.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The matched entity.
*
* @return string
- * The description for this entity.
+ * The metadata for this entity.
*/
protected function buildDescription(EntityInterface $entity) {
- $description = \Drupal::token()->replace($this->configuration['result_description'], [$this->targetType => $entity], []);
+ $description = \Drupal::token()->replace($this->configuration['metadata'], [$this->targetType => $entity], []);
return LinkitXss::descriptionFilter($description);
}
diff --git a/src/Plugin/Linkit/Matcher/FileMatcher.php b/src/Plugin/Linkit/Matcher/FileMatcher.php
index f7d8528..1b53e5d 100644
--- a/src/Plugin/Linkit/Matcher/FileMatcher.php
+++ b/src/Plugin/Linkit/Matcher/FileMatcher.php
@@ -88,8 +88,15 @@ class FileMatcher extends EntityMatcher {
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form = parent::buildConfigurationForm($form, $form_state);
+ $form['extensions'] = array(
+ '#type' => 'details',
+ '#title' => t('File extensions'),
+ '#open' => TRUE,
+ '#weight' => -100,
+ );
+
$file_extensions = str_replace(' ', ', ', $this->configuration['file_extensions']);
- $form['file_extensions'] = [
+ $form['extensions']['file_extensions'] = [
'#type' => 'textfield',
'#title' => $this->t('Allowed file extensions'),
'#default_value' => $file_extensions,
@@ -102,6 +109,7 @@ class FileMatcher extends EntityMatcher {
'#type' => 'details',
'#title' => t('Image file settings'),
'#description' => t('Extra settings for image files in the result.'),
+ '#open' => TRUE,
'#tree' => TRUE,
];
diff --git a/src/Plugin/Linkit/Matcher/NodeMatcher.php b/src/Plugin/Linkit/Matcher/NodeMatcher.php
index bee20ec..6a3d81a 100644
--- a/src/Plugin/Linkit/Matcher/NodeMatcher.php
+++ b/src/Plugin/Linkit/Matcher/NodeMatcher.php
@@ -53,11 +53,17 @@ class NodeMatcher extends EntityMatcher {
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form = parent::buildConfigurationForm($form, $form_state);
- $form['include_unpublished'] = [
+ $form['unpublished_nodes'] = array(
+ '#type' => 'details',
+ '#title' => t('Unpublished nodes'),
+ '#open' => TRUE,
+ );
+
+ $form['unpublished_nodes']['include_unpublished'] = [
'#title' => t('Include unpublished nodes'),
'#type' => 'checkbox',
'#default_value' => $this->configuration['include_unpublished'],
- '#description' => t('In order to see unpublished nodes, the requesting user must also have permissions to do so.'),
+ '#description' => t('In order to see unpublished nodes, users must also have permissions to do so.'),
];
return $form;
diff --git a/src/Plugin/Linkit/Matcher/TermMatcher.php b/src/Plugin/Linkit/Matcher/TermMatcher.php
index 7f73c69..fcab6be 100644
--- a/src/Plugin/Linkit/Matcher/TermMatcher.php
+++ b/src/Plugin/Linkit/Matcher/TermMatcher.php
@@ -40,7 +40,7 @@ class TermMatcher extends EntityMatcher {
* {@inheritdoc}
*/
protected function buildDescription(EntityInterface $entity) {
- $description = \Drupal::token()->replace($this->configuration['result_description'], ['term' => $entity], []);
+ $description = \Drupal::token()->replace($this->configuration['metadata'], ['term' => $entity], []);
return LinkitXss::descriptionFilter($description);
}
diff --git a/src/Plugin/Linkit/Matcher/UserMatcher.php b/src/Plugin/Linkit/Matcher/UserMatcher.php
index d937bc5..ea1e746 100644
--- a/src/Plugin/Linkit/Matcher/UserMatcher.php
+++ b/src/Plugin/Linkit/Matcher/UserMatcher.php
@@ -60,20 +60,33 @@ class UserMatcher extends EntityMatcher {
public function buildConfigurationForm(array $form, FormStateInterface $form_state) {
$form = parent::buildConfigurationForm($form, $form_state);
- $form['roles'] = [
+ $form['role_restrictions'] = array(
+ '#type' => 'details',
+ '#title' => t('Role restrictions'),
+ '#open' => TRUE,
+ '#weight' => -90,
+ );
+
+ $form['role_restrictions']['roles'] = [
'#type' => 'checkboxes',
'#title' => $this->t('Restrict to the selected roles'),
'#options' => array_diff_key(user_role_names(TRUE), [RoleInterface::AUTHENTICATED_ID => RoleInterface::AUTHENTICATED_ID]),
'#default_value' => $this->configuration['roles'],
- '#description' => $this->t('If none of the checkboxes is checked, allow all roles.'),
+ '#description' => $this->t('If none of the checkboxes is checked, all roles are allowed.'),
'#element_validate' => [[get_class($this), 'elementValidateFilter']],
];
- $form['include_blocked'] = [
+ $form['blocked_users'] = array(
+ '#type' => 'details',
+ '#title' => t('Blocked users'),
+ '#open' => TRUE,
+ );
+
+ $form['blocked_users']['include_blocked'] = [
'#title' => t('Include blocked user'),
'#type' => 'checkbox',
'#default_value' => $this->configuration['include_blocked'],
- '#description' => t('In order to see blocked users, the requesting user must also have permissions to do so.'),
+ '#description' => t('In order to see blocked users, users must have permissions to do so.'),
];
return $form;
diff --git a/src/Tests/Update/LinkitUpdate8501.php b/src/Tests/Update/LinkitUpdate8501.php
deleted file mode 100644
index cadbec6..0000000
--- a/src/Tests/Update/LinkitUpdate8501.php
+++ /dev/null
@@ -1,58 +0,0 @@
-<?php
-
-namespace Drupal\linkit\Tests\Update;
-
-use Drupal\filter\Entity\FilterFormat;
-use Drupal\system\Tests\Update\UpdatePathTestBase;
-
-/**
- * Tests Linkit upgrade path for update 8501.
- *
- * @group Update
- */
-class LinkitUpdate8501 extends UpdatePathTestBase {
-
- /**
- * The config factory service.
- *
- * @var \Drupal\Core\Config\ConfigFactoryInterface
- */
- protected $configFactory;
-
- /**
- * {@inheritdoc}
- */
- protected function setUp() {
- parent::setUp();
- $this->configFactory = $this->container->get('config.factory');
- }
-
- /**
- * Set database dump files to be used.
- */
- protected function setDatabaseDumpFiles() {
- $this->databaseDumpFiles = [
- __DIR__ . '/../../../tests/fixtures/update/linkit-4-to-5/drupal-8.linkit-enabled.standard.php.gz',
- __DIR__ . '/../../../tests/fixtures/update/8501/linkit-update-8501.php',
- ];
- }
-
- /**
- * Tests linkit_update_8501().
- *
- * @see linkit_update_8501()
- */
- public function testLinkitUpdate8501() {
- $this->runUpdates();
-
- $test_profile = $this->configFactory->get('linkit.linkit_profile.test_profile');
- $this->assertEqual('canonical', $test_profile->get('matchers.fc48c807-2a9c-44eb-b86b-7e134c1aa252.settings.substitution_type'), 'Content matcher has a substitution type of canonical.');
- $this->assertEqual('file', $test_profile->get('matchers.b8d6d672-6377-493f-b492-3cc69511cf17.settings.substitution_type'), 'File matcher has a substitution type of file.');
-
- $htmlRestrictions = FilterFormat::load('format_1')->getHtmlRestrictions();
- $this->assertTrue(array_key_exists("data-entity-type", $htmlRestrictions['allowed']['a']));
- $this->assertTrue(array_key_exists("data-entity-uuid", $htmlRestrictions['allowed']['a']));
- $this->assertTrue(array_key_exists("data-entity-substitution", $htmlRestrictions['allowed']['a']));
- }
-
-}
diff --git a/src/Tests/Update/LinkitUpdateTest.php b/src/Tests/Update/LinkitUpdateTest.php
index 66b39ad..a17bd80 100644
--- a/src/Tests/Update/LinkitUpdateTest.php
+++ b/src/Tests/Update/LinkitUpdateTest.php
@@ -32,8 +32,8 @@ class LinkitUpdateTest extends UpdatePathTestBase {
*/
protected function setDatabaseDumpFiles() {
$this->databaseDumpFiles = [
- __DIR__ . '/../../../tests/fixtures/update/linkit-4-to-5/drupal-8.linkit-enabled.standard.php.gz',
- __DIR__ . '/../../../tests/fixtures/update/linkit-4-to-5/linkit-4-to-5.php',
+ __DIR__ . '/../../../tests/fixtures/update/drupal-8.linkit-enabled.standard.php.gz',
+ __DIR__ . '/../../../tests/fixtures/update/linkit-additions.php',
];
}
@@ -98,4 +98,38 @@ class LinkitUpdateTest extends UpdatePathTestBase {
$this->assertTrue(array_key_exists("data-entity-uuid", $htmlRestrictions['allowed']['a']));
}
+ /**
+ * Tests linkit_update_8501().
+ *
+ * @see linkit_update_8501()
+ */
+ public function testLinkitUpdate8501() {
+ $this->runUpdates();
+
+ $test_profile = $this->configFactory->get('linkit.linkit_profile.test_profile');
+ $this->assertEqual('canonical', $test_profile->get('matchers.fc48c807-2a9c-44eb-b86b-7e134c1aa252.settings.substitution_type'), 'Content matcher has a substitution type of canonical.');
+ $this->assertEqual('file', $test_profile->get('matchers.b8d6d672-6377-493f-b492-3cc69511cf17.settings.substitution_type'), 'File matcher has a substitution type of file.');
+
+ $htmlRestrictions = FilterFormat::load('format_1')->getHtmlRestrictions();
+ $this->assertTrue(array_key_exists("data-entity-type", $htmlRestrictions['allowed']['a']));
+ $this->assertTrue(array_key_exists("data-entity-uuid", $htmlRestrictions['allowed']['a']));
+ $this->assertTrue(array_key_exists("data-entity-substitution", $htmlRestrictions['allowed']['a']));
+ }
+
+ /**
+ * Tests linkit_update_8502().
+ *
+ * @see linkit_update_8502()
+ */
+ public function testLinkitUpdate8502() {
+ $test_profile = $this->configFactory->get('linkit.linkit_profile.test_profile');
+ $this->assertNotNull($test_profile->get('matchers.fc48c807-2a9c-44eb-b86b-7e134c1aa252.settings.result_description'), 'Profile have result_description');
+
+ $this->runUpdates();
+
+ $test_profile = $this->configFactory->get('linkit.linkit_profile.test_profile');
+ $this->assertNull($test_profile->get('matchers.fc48c807-2a9c-44eb-b86b-7e134c1aa252.settings.result_description'), 'Profile does not have result_description');
+ $this->assertNotNull($test_profile->get('matchers.fc48c807-2a9c-44eb-b86b-7e134c1aa252.settings.metadata'), 'Profile have metadata');
+ }
+
}
diff --git a/tests/fixtures/update/8501/editor.editor.format_1.yml b/tests/fixtures/update/8501/editor.editor.format_1.yml
deleted file mode 100644
index 46a0f3f..0000000
--- a/tests/fixtures/update/8501/editor.editor.format_1.yml
+++ /dev/null
@@ -1,25 +0,0 @@
-uuid: 5600b759-8f91-49fa-88f0-a69f4c8ed440
-langcode: en
-status: true
-dependencies:
- config:
- - filter.format.format_1
- module:
- - ckeditor
-format: format_1
-editor: ckeditor
-settings:
- toolbar:
- rows:
- -
- -
- name: Links
- items:
- - Linkit
- plugins:
- stylescombo:
- styles: ''
- language:
- language_list: un
- linkit:
- linkit_profile: test_profile
diff --git a/tests/fixtures/update/8501/filter.format.format_1.yml b/tests/fixtures/update/8501/filter.format.format_1.yml
deleted file mode 100644
index 619bba2..0000000
--- a/tests/fixtures/update/8501/filter.format.format_1.yml
+++ /dev/null
@@ -1,17 +0,0 @@
-uuid: ff6b71a0-5051-4857-a0a8-28a670b7317d
-langcode: en
-status: true
-dependencies: { }
-name: 'Format 1'
-format: format_1
-weight: 0
-filters:
- filter_html:
- id: filter_html
- provider: filter
- status: true
- weight: -10
- settings:
- allowed_html: '<a href hreflang data-entity-type data-entity-uuid> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type=''1 A I''> <li> <dl> <dt> <dd> <h2 id=''jump-*''> <h3 id> <h4 id> <h5 id> <h6 id>'
- filter_html_help: true
- filter_html_nofollow: false
diff --git a/tests/fixtures/update/8501/linkit-update-8501.php b/tests/fixtures/update/8501/linkit-update-8501.php
deleted file mode 100644
index d7bdc2b..0000000
--- a/tests/fixtures/update/8501/linkit-update-8501.php
+++ /dev/null
@@ -1,66 +0,0 @@
-<?php
-
-/**
- * @file
- * Database fixture for testing the upgrade path for Linkit 4 to 5.
- *
- * Contains database additions to drupal-8.bare.standard.php.gz for testing the
- * upgrade path for Linkit 4 to 5.
- */
-
-use Drupal\Component\Serialization\Yaml;
-use Drupal\Core\Database\Database;
-
-$connection = Database::getConnection();
-
-// Configuration for linkit profiles.
-$config = Yaml::decode(file_get_contents(__DIR__ . '/linkit.linkit_profile.test_profile.yml'));
-$connection->insert('config')
- ->fields([
- 'collection',
- 'name',
- 'data',
- ])
- ->values([
- 'collection' => '',
- 'name' => 'linkit.linkit_profile.' . $config['id'],
- 'data' => serialize($config),
- ])
- ->execute();
-
-
-// Configuration for text formats.
-$configs = [];
-$configs[] = Yaml::decode(file_get_contents(__DIR__ . '/filter.format.format_1.yml'));
-foreach ($configs as $config) {
- $connection->insert('config')
- ->fields([
- 'collection',
- 'name',
- 'data',
- ])
- ->values([
- 'collection' => '',
- 'name' => 'filter.format.' . $config['format'],
- 'data' => serialize($config),
- ])
- ->execute();
-}
-
-// Configuration for editors.
-$configs = [];
-$configs[] = Yaml::decode(file_get_contents(__DIR__ . '/editor.editor.format_1.yml'));
-foreach ($configs as $config) {
- $connection->insert('config')
- ->fields([
- 'collection',
- 'name',
- 'data',
- ])
- ->values([
- 'collection' => '',
- 'name' => 'editor.editor.' . $config['format'],
- 'data' => serialize($config),
- ])
- ->execute();
-}
diff --git a/tests/fixtures/update/8501/linkit.linkit_profile.test_profile.yml b/tests/fixtures/update/8501/linkit.linkit_profile.test_profile.yml
deleted file mode 100644
index bee4523..0000000
--- a/tests/fixtures/update/8501/linkit.linkit_profile.test_profile.yml
+++ /dev/null
@@ -1,47 +0,0 @@
-uuid: e91c2255-2146-46fb-af58-1b391113c352
-langcode: en
-status: true
-dependencies:
- module:
- - file
- - node
-id: test_profile
-label: 'Test profile'
-description: 'This is a test profile'
-attributes:
- target:
- id: target
- weight: 0
- settings:
- widget_type: simple_checkbox
- title:
- id: title
- weight: 0
- settings:
- automatic_title: false
- accesskey:
- id: accesskey
- weight: 0
- settings: { }
-matchers:
- fc48c807-2a9c-44eb-b86b-7e134c1aa252:
- uuid: fc48c807-2a9c-44eb-b86b-7e134c1aa252
- id: 'entity:node'
- weight: 0
- settings:
- result_description: 'by [node:author] | [node:created:medium]'
- bundles: { }
- group_by_bundle: false
- include_unpublished: false
- b8d6d672-6377-493f-b492-3cc69511cf17:
- uuid: b8d6d672-6377-493f-b492-3cc69511cf17
- id: 'entity:file'
- weight: 0
- settings:
- result_description: '[file:path] [file:url]'
- bundles: null
- group_by_bundle: null
- images:
- show_dimensions: false
- show_thumbnail: false
- thumbnail_image_style: null
diff --git a/tests/fixtures/update/linkit-4-to-5/drupal-8.linkit-enabled.standard.php.gz b/tests/fixtures/update/drupal-8.linkit-enabled.standard.php.gz
index 8d7de7f..8d7de7f 100644
--- a/tests/fixtures/update/linkit-4-to-5/drupal-8.linkit-enabled.standard.php.gz
+++ b/tests/fixtures/update/drupal-8.linkit-enabled.standard.php.gz
Binary files differ
diff --git a/tests/fixtures/update/linkit-4-to-5/editor.editor.format_1.yml b/tests/fixtures/update/editor.editor.format_1.yml
index c4f2c5d..c4f2c5d 100644
--- a/tests/fixtures/update/linkit-4-to-5/editor.editor.format_1.yml
+++ b/tests/fixtures/update/editor.editor.format_1.yml
diff --git a/tests/fixtures/update/linkit-4-to-5/editor.editor.format_2.yml b/tests/fixtures/update/editor.editor.format_2.yml
index 3456d0f..3456d0f 100644
--- a/tests/fixtures/update/linkit-4-to-5/editor.editor.format_2.yml
+++ b/tests/fixtures/update/editor.editor.format_2.yml
diff --git a/tests/fixtures/update/linkit-4-to-5/editor.editor.format_3.yml b/tests/fixtures/update/editor.editor.format_3.yml
index 91a0dba..91a0dba 100644
--- a/tests/fixtures/update/linkit-4-to-5/editor.editor.format_3.yml
+++ b/tests/fixtures/update/editor.editor.format_3.yml
diff --git a/tests/fixtures/update/linkit-4-to-5/filter.format.format_1.yml b/tests/fixtures/update/filter.format.format_1.yml
index 8e2bf9f..8e2bf9f 100644
--- a/tests/fixtures/update/linkit-4-to-5/filter.format.format_1.yml
+++ b/tests/fixtures/update/filter.format.format_1.yml
diff --git a/tests/fixtures/update/linkit-4-to-5/filter.format.format_2.yml b/tests/fixtures/update/filter.format.format_2.yml
index 1bd9a2b..1bd9a2b 100644
--- a/tests/fixtures/update/linkit-4-to-5/filter.format.format_2.yml
+++ b/tests/fixtures/update/filter.format.format_2.yml
diff --git a/tests/fixtures/update/linkit-4-to-5/filter.format.format_3.yml b/tests/fixtures/update/filter.format.format_3.yml
index 4957f59..4957f59 100644
--- a/tests/fixtures/update/linkit-4-to-5/filter.format.format_3.yml
+++ b/tests/fixtures/update/filter.format.format_3.yml
diff --git a/tests/fixtures/update/linkit-4-to-5/linkit-4-to-5.php b/tests/fixtures/update/linkit-additions.php
index 4e661ff..7e57ee4 100644
--- a/tests/fixtures/update/linkit-4-to-5/linkit-4-to-5.php
+++ b/tests/fixtures/update/linkit-additions.php
@@ -2,10 +2,10 @@
/**
* @file
- * Database fixture for testing the upgrade path for Linkit 4 to 5.
+ * Database fixture for testing the update hooks.
*
* Contains database additions to drupal-8.bare.standard.php.gz for testing the
- * upgrade path for Linkit 4 to 5.
+ * update hooks.
*/
use Drupal\Component\Serialization\Yaml;
diff --git a/tests/fixtures/update/linkit-4-to-5/linkit.linkit_profile.test_profile.yml b/tests/fixtures/update/linkit.linkit_profile.test_profile.yml
index bee4523..bee4523 100644
--- a/tests/fixtures/update/linkit-4-to-5/linkit.linkit_profile.test_profile.yml
+++ b/tests/fixtures/update/linkit.linkit_profile.test_profile.yml