Skip to content
Snippets Groups Projects
Commit 77a2d8fb authored by catch's avatar catch
Browse files

Issue #2723623 by stevo70, aofficer, valthebald, bearcoder: Remove...

Issue #2723623 by stevo70, aofficer, valthebald, bearcoder: Remove entity_load* usage for search_page entity type
parent 0d9fa5c0
No related branches found
No related tags found
No related merge requests found
......@@ -3,6 +3,7 @@
namespace Drupal\search\Tests;
use Drupal\Core\Url;
use Drupal\search\Entity\SearchPage;
/**
* Verify the search config settings form.
......@@ -145,7 +146,7 @@ function testSearchModuleDisabling() {
);
$plugins = array_keys($plugin_info);
/** @var $entities \Drupal\search\SearchPageInterface[] */
$entities = entity_load_multiple('search_page');
$entities = SearchPage::loadMultiple();
// Disable all of the search pages.
foreach ($entities as $entity) {
$entity->disable()->save();
......
......@@ -6,6 +6,7 @@
use Drupal\comment\Tests\CommentTestTrait;
use Drupal\Core\Url;
use Drupal\filter\Entity\FilterFormat;
use Drupal\search\Entity\SearchPage;
/**
* Indexes content and tests ranking factors.
......@@ -34,7 +35,7 @@ protected function setUp() {
parent::setUp();
// Create a plugin instance.
$this->nodeSearch = entity_load('search_page', 'node_search');
$this->nodeSearch = SearchPage::load('node_search');
// Log in with sufficient privileges.
$this->drupalLogin($this->drupalCreateUser(array('post comments', 'skip comment approval', 'create page content', 'administer search')));
......@@ -126,7 +127,7 @@ public function testRankings() {
$this->assertTrue($this->xpath('//select[@id="edit-rankings-' . $node_rank . '-value"]//option[@value="10"]'), 'Select list to prioritize ' . $node_rank . ' for node ranks is visible and set to 10.');
// Reload the plugin to get the up-to-date values.
$this->nodeSearch = entity_load('search_page', 'node_search');
$this->nodeSearch = SearchPage::load('node_search');
// Do the search and assert the results.
$this->nodeSearch->getPlugin()->setSearch('rocks', array(), array());
$set = $this->nodeSearch->getPlugin()->execute();
......
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