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

Issue #3092430 by quietone, shrutidkadam, RdeBoer, bgprior, danflanagan8:...

Issue #3092430 by quietone, shrutidkadam, RdeBoer, bgprior, danflanagan8: Ensure SearchPlugin has a configuration array

(cherry picked from commit 331e284e)
parent 2a5f29ee
No related branches found
No related tags found
No related merge requests found
......@@ -41,6 +41,9 @@ process:
- module
- 'constants/suffix'
path: module
configuration:
plugin: default_value
default_value: [ ]
'configuration/rankings':
plugin: search_configuration_rankings
destination:
......
......@@ -21,6 +21,9 @@ process:
id: 'constants/id'
path: 'constants/path'
plugin: 'constants/plugin'
configuration:
plugin: default_value
default_value: [ ]
'configuration/rankings':
plugin: search_configuration_rankings
destination:
......
......@@ -60,6 +60,20 @@ public function testSearchPage() {
$configuration = SearchPage::load($id)->getPlugin()->getConfiguration();
$this->assertSame(4, $configuration['rankings']['comments']);
// Test that a configurable search without a configuration imports. Do this
// by removing the node rankings from the source database.
Database::getConnection('default', 'migrate')
->delete('variable')
->condition('name', 'node_rank_%', 'LIKE')
->execute();
$migration = $this->getMigration('search_page');
$migration->getIdMap()->prepareUpdate();
$this->executeMigration($migration);
$configuration = SearchPage::load($id)->getPlugin()->getConfiguration();
$this->assertSame([], $configuration['rankings']);
}
}
......@@ -79,6 +79,19 @@ public function testSearchPage() {
$this->executeMigration($migration);
$configuration['rankings']['comments'] = 4;
$this->assertEntity('node_search', 'node', TRUE, $configuration);
// Test that a configurable search without a configuration imports. Do this
// by removing the node rankings from the source database.
Database::getConnection('default', 'migrate')
->delete('variable')
->condition('name', 'node_rank_%', 'LIKE')
->execute();
$migration = $this->getMigration('d7_search_page');
$migration->getIdMap()->prepareUpdate();
$this->executeMigration($migration);
$configuration = ['rankings' => []];
$this->assertEntity('node_search', 'node', TRUE, $configuration);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment