Issue #3092430 by quietone, shrutidkadam, RdeBoer, bgprior, danflanagan8: Ensure SearchPlugin has a configuration array
(cherry picked from commit 331e284ef0
)
merge-requests/1590/head
parent
2a5f29ee57
commit
62dc0bc471
|
@ -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 @@ class MigrateSearchPageTest extends MigrateDrupal6TestBase {
|
|||
|
||||
$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 @@ class MigrateSearchPageTest extends MigrateDrupal7TestBase {
|
|||
$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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue