Update to Drupal 8.1.0. For more information, see https://www.drupal.org/drupal-8.1.0-release-notes
This commit is contained in:
parent
b11a755ba8
commit
c0a0d5a94c
6920 changed files with 64395 additions and 57312 deletions
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\search_embedded_form\Form\SearchEmbeddedForm.
|
||||
*/
|
||||
|
||||
namespace Drupal\search_embedded_form\Form;
|
||||
|
||||
use Drupal\Core\Form\FormBase;
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\search_extra_type\Plugin\Search\SearchExtraTypeSearch.
|
||||
*/
|
||||
|
||||
namespace Drupal\search_extra_type\Plugin\Search;
|
||||
|
||||
use Drupal\Component\Utility\SafeMarkup;
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
<?php
|
||||
|
||||
use Drupal\Core\Database\Query\AlterableInterface;
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Test module that alters search queries.
|
||||
*/
|
||||
|
||||
use Drupal\Core\Database\Query\AlterableInterface;
|
||||
|
||||
/**
|
||||
* Implements hook_query_TAG_alter(): tag search_$type with $type node_search.
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,65 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\search\Kernel\Migrate\d6;
|
||||
|
||||
use Drupal\Core\Database\Database;
|
||||
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||
use Drupal\search\Entity\SearchPage;
|
||||
|
||||
/**
|
||||
* Upgrade search rank settings to search.page.*.yml.
|
||||
*
|
||||
* @group migrate_drupal_6
|
||||
*/
|
||||
class MigrateSearchPageTest extends MigrateDrupal6TestBase {
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = ['search'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->executeMigration('search_page');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests Drupal 6 search settings to Drupal 8 search page entity migration.
|
||||
*/
|
||||
public function testSearchPage() {
|
||||
$id = 'node_search';
|
||||
/** @var \Drupal\search\Entity\SearchPage $search_page */
|
||||
$search_page = SearchPage::load($id);
|
||||
$this->assertIdentical($id, $search_page->id());
|
||||
$configuration = $search_page->getPlugin()->getConfiguration();
|
||||
$this->assertIdentical($configuration['rankings'], array(
|
||||
'comments' => 5,
|
||||
'promote' => 0,
|
||||
'recent' => 0,
|
||||
'relevance' => 2,
|
||||
'sticky' => 8,
|
||||
'views' => 1,
|
||||
));
|
||||
$this->assertIdentical('node', $search_page->getPath());
|
||||
|
||||
// Test that we can re-import using the EntitySearchPage destination.
|
||||
Database::getConnection('default', 'migrate')
|
||||
->update('variable')
|
||||
->fields(array('value' => serialize(4)))
|
||||
->condition('name', 'node_rank_comments')
|
||||
->execute();
|
||||
|
||||
/** @var \Drupal\migrate\Plugin\MigrationInterface $migration */
|
||||
$migration = $this->getMigration('search_page');
|
||||
// Indicate we're rerunning a migration that's already run.
|
||||
$migration->getIdMap()->prepareUpdate();
|
||||
$this->executeMigration($migration);
|
||||
|
||||
$configuration = SearchPage::load($id)->getPlugin()->getConfiguration();
|
||||
$this->assertIdentical(4, $configuration['rankings']['comments']);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\search\Kernel\Migrate\d6;
|
||||
|
||||
use Drupal\config\Tests\SchemaCheckTestTrait;
|
||||
use Drupal\Tests\migrate_drupal\Kernel\d6\MigrateDrupal6TestBase;
|
||||
|
||||
/**
|
||||
* Upgrade variables to search.settings.yml.
|
||||
*
|
||||
* @group migrate_drupal_6
|
||||
*/
|
||||
class MigrateSearchSettingsTest extends MigrateDrupal6TestBase {
|
||||
|
||||
use SchemaCheckTestTrait;
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = ['search'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->executeMigration('d6_search_settings');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests migration of search variables to search.settings.yml.
|
||||
*/
|
||||
public function testSearchSettings() {
|
||||
$config = $this->config('search.settings');
|
||||
$this->assertIdentical(3, $config->get('index.minimum_word_size'));
|
||||
$this->assertIdentical(TRUE, $config->get('index.overlap_cjk'));
|
||||
$this->assertIdentical(100, $config->get('index.cron_limit'));
|
||||
$this->assertIdentical(TRUE, $config->get('logging'));
|
||||
$this->assertConfigSchema(\Drupal::service('config.typed'), 'search.settings', $config->get());
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,67 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\search\Kernel\Migrate\d7;
|
||||
|
||||
use Drupal\Core\Database\Database;
|
||||
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
|
||||
use Drupal\search\Entity\SearchPage;
|
||||
|
||||
/**
|
||||
* Upgrade search rank settings to search.page.*.yml.
|
||||
*
|
||||
* @group migrate_drupal_7
|
||||
*/
|
||||
class MigrateSearchPageTest extends MigrateDrupal7TestBase {
|
||||
|
||||
/**
|
||||
* The modules to be enabled during the test.
|
||||
*
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public static $modules = array('node', 'search');
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->executeMigration('search_page');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests Drupal 7 search ranking to Drupal 8 search page entity migration.
|
||||
*/
|
||||
public function testSearchPage() {
|
||||
$id = 'node_search';
|
||||
/** @var \Drupal\search\Entity\SearchPage $search_page */
|
||||
$search_page = SearchPage::load($id);
|
||||
$this->assertIdentical($id, $search_page->id());
|
||||
$configuration = $search_page->getPlugin()->getConfiguration();
|
||||
$expected_rankings = array(
|
||||
'comments' => 0,
|
||||
'promote' => 0,
|
||||
'relevance' => 2,
|
||||
'sticky' => 0,
|
||||
'views' => 0,
|
||||
);
|
||||
$this->assertIdentical($expected_rankings, $configuration['rankings']);
|
||||
$this->assertIdentical('node', $search_page->getPath());
|
||||
|
||||
// Test that we can re-import using the EntitySearchPage destination.
|
||||
Database::getConnection('default', 'migrate')
|
||||
->update('variable')
|
||||
->fields(array('value' => serialize(4)))
|
||||
->condition('name', 'node_rank_comments')
|
||||
->execute();
|
||||
|
||||
/** @var \Drupal\migrate\Plugin\MigrationInterface $migration */
|
||||
$migration = $this->getMigration('search_page');
|
||||
// Indicate we're rerunning a migration that's already run.
|
||||
$migration->getIdMap()->prepareUpdate();
|
||||
$this->executeMigration($migration);
|
||||
|
||||
$configuration = SearchPage::load($id)->getPlugin()->getConfiguration();
|
||||
$this->assertIdentical(4, $configuration['rankings']['comments']);
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
namespace Drupal\Tests\search\Kernel\Migrate\d7;
|
||||
|
||||
use Drupal\Tests\migrate_drupal\Kernel\d7\MigrateDrupal7TestBase;
|
||||
|
||||
/**
|
||||
* Tests migration of Search variables to configuration.
|
||||
*
|
||||
* @group search
|
||||
*/
|
||||
class MigrateSearchSettingsTest extends MigrateDrupal7TestBase {
|
||||
|
||||
public static $modules = ['search'];
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function setUp() {
|
||||
parent::setUp();
|
||||
$this->executeMigration('d7_search_settings');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests the migration of Search's variables to configuration.
|
||||
*/
|
||||
public function testSearchSettings() {
|
||||
$config = $this->config('search.settings');
|
||||
$this->assertIdentical('node_search', $config->get('default_page'));
|
||||
$this->assertIdentical(4, $config->get('index.minimum_word_size'));
|
||||
$this->assertTrue($config->get('index.overlap_cjk'));
|
||||
$this->assertIdentical(100, $config->get('index.cron_limit'));
|
||||
$this->assertIdentical(7, $config->get('and_or_limit'));
|
||||
$this->assertIdentical(25, $config->get('index.tag_weights.h1'));
|
||||
$this->assertIdentical(18, $config->get('index.tag_weights.h2'));
|
||||
$this->assertIdentical(15, $config->get('index.tag_weights.h3'));
|
||||
$this->assertIdentical(12, $config->get('index.tag_weights.h4'));
|
||||
$this->assertIdentical(9, $config->get('index.tag_weights.h5'));
|
||||
$this->assertIdentical(6, $config->get('index.tag_weights.h6'));
|
||||
$this->assertIdentical(3, $config->get('index.tag_weights.u'));
|
||||
$this->assertIdentical(3, $config->get('index.tag_weights.b'));
|
||||
$this->assertIdentical(3, $config->get('index.tag_weights.i'));
|
||||
$this->assertIdentical(3, $config->get('index.tag_weights.strong'));
|
||||
$this->assertIdentical(3, $config->get('index.tag_weights.em'));
|
||||
$this->assertIdentical(10, $config->get('index.tag_weights.a'));
|
||||
$this->assertTrue($config->get('logging'));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,10 +1,5 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Contains \Drupal\Tests\search\Unit\SearchPluginCollectionTest.
|
||||
*/
|
||||
|
||||
namespace Drupal\Tests\search\Unit;
|
||||
|
||||
use Drupal\search\Plugin\SearchPluginCollection;
|
||||
|
|
Reference in a new issue