Commit 12415865 authored by alexpott's avatar alexpott

Issue #2380429 by tibbsa, hussainweb, jhodgdon, markat: Clean-up search module...

Issue #2380429 by tibbsa, hussainweb, jhodgdon, markat: Clean-up search module test members - ensure property definition and use of camelCase naming convention
parent 1d29fd0a
...@@ -13,6 +13,12 @@ ...@@ -13,6 +13,12 @@
* @group search * @group search
*/ */
class SearchAdvancedSearchFormTest extends SearchTestBase { class SearchAdvancedSearchFormTest extends SearchTestBase {
/**
* A node to use for testing.
*
* @var \Drupal\node\NodeInterface
*/
protected $node; protected $node;
protected function setUp() { protected function setUp() {
......
...@@ -30,25 +30,36 @@ class SearchCommentCountToggleTest extends SearchTestBase { ...@@ -30,25 +30,36 @@ class SearchCommentCountToggleTest extends SearchTestBase {
*/ */
public static $modules = array('node', 'comment'); public static $modules = array('node', 'comment');
protected $searching_user; /**
protected $searchable_nodes; * A user with permission to search and post comments.
*
* @var \Drupal\user\UserInterface
*/
protected $searchingUser;
/**
* Array of nodes available to search.
*
* @var \Drupal\node\NodeInterface[]
*/
protected $searchableNodes;
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
// Create searching user. // Create searching user.
$this->searching_user = $this->drupalCreateUser(array('search content', 'access content', 'access comments', 'post comments', 'skip comment approval')); $this->searchingUser = $this->drupalCreateUser(array('search content', 'access content', 'access comments', 'post comments', 'skip comment approval'));
// Login with sufficient privileges. // Login with sufficient privileges.
$this->drupalLogin($this->searching_user); $this->drupalLogin($this->searchingUser);
// Add a comment field. // Add a comment field.
$this->container->get('comment.manager')->addDefaultField('node', 'article'); $this->container->get('comment.manager')->addDefaultField('node', 'article');
// Create initial nodes. // Create initial nodes.
$node_params = array('type' => 'article', 'body' => array(array('value' => 'SearchCommentToggleTestCase'))); $node_params = array('type' => 'article', 'body' => array(array('value' => 'SearchCommentToggleTestCase')));
$this->searchable_nodes['1 comment'] = $this->drupalCreateNode($node_params); $this->searchableNodes['1 comment'] = $this->drupalCreateNode($node_params);
$this->searchable_nodes['0 comments'] = $this->drupalCreateNode($node_params); $this->searchableNodes['0 comments'] = $this->drupalCreateNode($node_params);
// Create a comment array // Create a comment array
$edit_comment = array(); $edit_comment = array();
...@@ -56,7 +67,7 @@ protected function setUp() { ...@@ -56,7 +67,7 @@ protected function setUp() {
$edit_comment['comment_body[0][value]'] = $this->randomMachineName(); $edit_comment['comment_body[0][value]'] = $this->randomMachineName();
// Post comment to the test node with comment // Post comment to the test node with comment
$this->drupalPostForm('comment/reply/node/' . $this->searchable_nodes['1 comment']->id() . '/comment', $edit_comment, t('Save')); $this->drupalPostForm('comment/reply/node/' . $this->searchableNodes['1 comment']->id() . '/comment', $edit_comment, t('Save'));
// First update the index. This does the initial processing. // First update the index. This does the initial processing.
$this->container->get('plugin.manager.search')->createInstance('node_search')->updateIndex(); $this->container->get('plugin.manager.search')->createInstance('node_search')->updateIndex();
...@@ -83,20 +94,20 @@ function testSearchCommentCountToggle() { ...@@ -83,20 +94,20 @@ function testSearchCommentCountToggle() {
$this->assertText(t('1 comment'), 'Non-empty comment count displays for nodes with comment status set to Open'); $this->assertText(t('1 comment'), 'Non-empty comment count displays for nodes with comment status set to Open');
// Test comment count display for nodes with comment status set to Closed // Test comment count display for nodes with comment status set to Closed
$this->searchable_nodes['0 comments']->set('comment', CommentItemInterface::CLOSED); $this->searchableNodes['0 comments']->set('comment', CommentItemInterface::CLOSED);
$this->searchable_nodes['0 comments']->save(); $this->searchableNodes['0 comments']->save();
$this->searchable_nodes['1 comment']->set('comment', CommentItemInterface::CLOSED); $this->searchableNodes['1 comment']->set('comment', CommentItemInterface::CLOSED);
$this->searchable_nodes['1 comment']->save(); $this->searchableNodes['1 comment']->save();
$this->drupalPostForm(NULL, $edit, t('Search')); $this->drupalPostForm(NULL, $edit, t('Search'));
$this->assertNoText(t('0 comments'), 'Empty comment count does not display for nodes with comment status set to Closed'); $this->assertNoText(t('0 comments'), 'Empty comment count does not display for nodes with comment status set to Closed');
$this->assertText(t('1 comment'), 'Non-empty comment count displays for nodes with comment status set to Closed'); $this->assertText(t('1 comment'), 'Non-empty comment count displays for nodes with comment status set to Closed');
// Test comment count display for nodes with comment status set to Hidden // Test comment count display for nodes with comment status set to Hidden
$this->searchable_nodes['0 comments']->set('comment', CommentItemInterface::HIDDEN); $this->searchableNodes['0 comments']->set('comment', CommentItemInterface::HIDDEN);
$this->searchable_nodes['0 comments']->save(); $this->searchableNodes['0 comments']->save();
$this->searchable_nodes['1 comment']->set('comment', CommentItemInterface::HIDDEN); $this->searchableNodes['1 comment']->set('comment', CommentItemInterface::HIDDEN);
$this->searchable_nodes['1 comment']->save(); $this->searchableNodes['1 comment']->save();
$this->drupalPostForm(NULL, $edit, t('Search')); $this->drupalPostForm(NULL, $edit, t('Search'));
$this->assertNoText(t('0 comments'), 'Empty comment count does not display for nodes with comment status set to Hidden'); $this->assertNoText(t('0 comments'), 'Empty comment count does not display for nodes with comment status set to Hidden');
......
...@@ -25,7 +25,33 @@ class SearchCommentTest extends SearchTestBase { ...@@ -25,7 +25,33 @@ class SearchCommentTest extends SearchTestBase {
*/ */
public static $modules = array('filter', 'node', 'comment'); public static $modules = array('filter', 'node', 'comment');
protected $admin_user; /**
* Test subject for comments.
*
* @var string
*/
protected $commentSubject;
/**
* ID for the administrator role.
*
* @var string
*/
protected $adminRole;
/**
* A user with various administrative permissions.
*
* @var \Drupal\user\UserInterface
*/
protected $adminUser;
/**
* Test node for searching.
*
* @var \Drupal\node\NodeInterface
*/
protected $node;
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
...@@ -49,8 +75,8 @@ protected function setUp() { ...@@ -49,8 +75,8 @@ protected function setUp() {
'skip comment approval', 'skip comment approval',
'access comments', 'access comments',
); );
$this->admin_user = $this->drupalCreateUser($permissions); $this->adminUser = $this->drupalCreateUser($permissions);
$this->drupalLogin($this->admin_user); $this->drupalLogin($this->adminUser);
// Add a comment field. // Add a comment field.
$this->container->get('comment.manager')->addDefaultField('node', 'article'); $this->container->get('comment.manager')->addDefaultField('node', 'article');
} }
...@@ -124,7 +150,7 @@ function testSearchResultsComment() { ...@@ -124,7 +150,7 @@ function testSearchResultsComment() {
$this->assertNoEscaped($edit_comment['comment_body[0][value]'], 'HTML in comment body is not escaped.'); $this->assertNoEscaped($edit_comment['comment_body[0][value]'], 'HTML in comment body is not escaped.');
// Hide comments. // Hide comments.
$this->drupalLogin($this->admin_user); $this->drupalLogin($this->adminUser);
$node->set('comment', CommentItemInterface::HIDDEN); $node->set('comment', CommentItemInterface::HIDDEN);
$node->save(); $node->save();
...@@ -142,9 +168,9 @@ function testSearchResultsComment() { ...@@ -142,9 +168,9 @@ function testSearchResultsComment() {
*/ */
function testSearchResultsCommentAccess() { function testSearchResultsCommentAccess() {
$comment_body = 'Test comment body'; $comment_body = 'Test comment body';
$this->comment_subject = 'Test comment subject'; $this->commentSubject = 'Test comment subject';
$roles = $this->admin_user->getRoles(TRUE); $roles = $this->adminUser->getRoles(TRUE);
$this->admin_role = $roles[0]; $this->adminRole = $roles[0];
// Create a node. // Create a node.
// Make preview optional. // Make preview optional.
...@@ -155,7 +181,7 @@ function testSearchResultsCommentAccess() { ...@@ -155,7 +181,7 @@ function testSearchResultsCommentAccess() {
// Post a comment using 'Full HTML' text format. // Post a comment using 'Full HTML' text format.
$edit_comment = array(); $edit_comment = array();
$edit_comment['subject[0][value]'] = $this->comment_subject; $edit_comment['subject[0][value]'] = $this->commentSubject;
$edit_comment['comment_body[0][value]'] = '<h1>' . $comment_body . '</h1>'; $edit_comment['comment_body[0][value]'] = '<h1>' . $comment_body . '</h1>';
$this->drupalPostForm('comment/reply/node/' . $this->node->id() . '/comment', $edit_comment, t('Save')); $this->drupalPostForm('comment/reply/node/' . $this->node->id() . '/comment', $edit_comment, t('Save'));
...@@ -166,17 +192,17 @@ function testSearchResultsCommentAccess() { ...@@ -166,17 +192,17 @@ function testSearchResultsCommentAccess() {
$this->setRolePermissions(DRUPAL_ANONYMOUS_RID, TRUE); $this->setRolePermissions(DRUPAL_ANONYMOUS_RID, TRUE);
$this->assertCommentAccess(TRUE, 'Anon user has search permission and access comments permission, comments should be indexed'); $this->assertCommentAccess(TRUE, 'Anon user has search permission and access comments permission, comments should be indexed');
$this->drupalLogin($this->admin_user); $this->drupalLogin($this->adminUser);
$this->drupalGet('admin/people/permissions'); $this->drupalGet('admin/people/permissions');
// Disable search access for authenticated user to test admin user. // Disable search access for authenticated user to test admin user.
$this->setRolePermissions(DRUPAL_AUTHENTICATED_RID, FALSE, FALSE); $this->setRolePermissions(DRUPAL_AUTHENTICATED_RID, FALSE, FALSE);
$this->setRolePermissions($this->admin_role); $this->setRolePermissions($this->adminRole);
$this->assertCommentAccess(FALSE, 'Admin user has search permission but no access comments permission, comments should not be indexed'); $this->assertCommentAccess(FALSE, 'Admin user has search permission but no access comments permission, comments should not be indexed');
$this->drupalGet('node/' . $this->node->id()); $this->drupalGet('node/' . $this->node->id());
$this->setRolePermissions($this->admin_role, TRUE); $this->setRolePermissions($this->adminRole, TRUE);
$this->assertCommentAccess(TRUE, 'Admin user has search permission and access comments permission, comments should be indexed'); $this->assertCommentAccess(TRUE, 'Admin user has search permission and access comments permission, comments should be indexed');
$this->setRolePermissions(DRUPAL_AUTHENTICATED_RID); $this->setRolePermissions(DRUPAL_AUTHENTICATED_RID);
...@@ -188,13 +214,13 @@ function testSearchResultsCommentAccess() { ...@@ -188,13 +214,13 @@ function testSearchResultsCommentAccess() {
// Verify that access comments permission is inherited from the // Verify that access comments permission is inherited from the
// authenticated role. // authenticated role.
$this->setRolePermissions(DRUPAL_AUTHENTICATED_RID, TRUE, FALSE); $this->setRolePermissions(DRUPAL_AUTHENTICATED_RID, TRUE, FALSE);
$this->setRolePermissions($this->admin_role); $this->setRolePermissions($this->adminRole);
$this->assertCommentAccess(TRUE, 'Admin user has search permission and no access comments permission, but comments should be indexed because admin user inherits authenticated user\'s permission to access comments'); $this->assertCommentAccess(TRUE, 'Admin user has search permission and no access comments permission, but comments should be indexed because admin user inherits authenticated user\'s permission to access comments');
// Verify that search content permission is inherited from the authenticated // Verify that search content permission is inherited from the authenticated
// role. // role.
$this->setRolePermissions(DRUPAL_AUTHENTICATED_RID, TRUE, TRUE); $this->setRolePermissions(DRUPAL_AUTHENTICATED_RID, TRUE, TRUE);
$this->setRolePermissions($this->admin_role, TRUE, FALSE); $this->setRolePermissions($this->adminRole, TRUE, FALSE);
$this->assertCommentAccess(TRUE, 'Admin user has access comments permission and no search permission, but comments should be indexed because admin user inherits authenticated user\'s permission to search'); $this->assertCommentAccess(TRUE, 'Admin user has access comments permission and no search permission, but comments should be indexed because admin user inherits authenticated user\'s permission to search');
} }
...@@ -219,13 +245,13 @@ function assertCommentAccess($assume_access, $message) { ...@@ -219,13 +245,13 @@ function assertCommentAccess($assume_access, $message) {
// Search for the comment subject. // Search for the comment subject.
$edit = array( $edit = array(
'keys' => "'" . $this->comment_subject . "'", 'keys' => "'" . $this->commentSubject . "'",
); );
$this->drupalPostForm('search/node', $edit, t('Search')); $this->drupalPostForm('search/node', $edit, t('Search'));
if ($assume_access) { if ($assume_access) {
$expected_node_result = $this->assertText($this->node->label()); $expected_node_result = $this->assertText($this->node->label());
$expected_comment_result = $this->assertText($this->comment_subject); $expected_comment_result = $this->assertText($this->commentSubject);
} }
else { else {
$expected_node_result = $this->assertText(t('Your search yielded no results.')); $expected_node_result = $this->assertText(t('Your search yielded no results.'));
......
...@@ -26,25 +26,25 @@ class SearchConfigSettingsFormTest extends SearchTestBase { ...@@ -26,25 +26,25 @@ class SearchConfigSettingsFormTest extends SearchTestBase {
* *
* @var \Drupal\user\UserInterface * @var \Drupal\user\UserInterface
*/ */
public $search_user; protected $searchUser;
/** /**
* Node indexed for searching. * Node indexed for searching.
* *
* @var \Drupal\node\NodeInterface * @var \Drupal\node\NodeInterface
*/ */
public $search_node; protected $searchNode;
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
// Login as a user that can create and search content. // Login as a user that can create and search content.
$this->search_user = $this->drupalCreateUser(array('search content', 'administer search', 'administer nodes', 'bypass node access', 'access user profiles', 'administer users', 'administer blocks', 'access site reports')); $this->searchUser = $this->drupalCreateUser(array('search content', 'administer search', 'administer nodes', 'bypass node access', 'access user profiles', 'administer users', 'administer blocks', 'access site reports'));
$this->drupalLogin($this->search_user); $this->drupalLogin($this->searchUser);
// Add a single piece of content and index it. // Add a single piece of content and index it.
$node = $this->drupalCreateNode(); $node = $this->drupalCreateNode();
$this->search_node = $node; $this->searchNode = $node;
// Link the node to itself to test that it's only indexed once. The content // Link the node to itself to test that it's only indexed once. The content
// also needs the word "pizza" so we can use it as the search keyword. // also needs the word "pizza" so we can use it as the search keyword.
$body_key = 'body[0][value]'; $body_key = 'body[0][value]';
...@@ -133,11 +133,11 @@ function testSearchModuleDisabling() { ...@@ -133,11 +133,11 @@ function testSearchModuleDisabling() {
$plugin_info = array( $plugin_info = array(
'node_search' => array( 'node_search' => array(
'keys' => 'pizza', 'keys' => 'pizza',
'text' => $this->search_node->label(), 'text' => $this->searchNode->label(),
), ),
'user_search' => array( 'user_search' => array(
'keys' => $this->search_user->getUsername(), 'keys' => $this->searchUser->getUsername(),
'text' => $this->search_user->getEmail(), 'text' => $this->searchUser->getEmail(),
), ),
'dummy_search_type' => array( 'dummy_search_type' => array(
'keys' => 'foo', 'keys' => 'foo',
......
...@@ -23,13 +23,17 @@ class SearchEmbedFormTest extends SearchTestBase { ...@@ -23,13 +23,17 @@ class SearchEmbedFormTest extends SearchTestBase {
/** /**
* Node used for testing. * Node used for testing.
*
* @var \Drupal\node\NodeInterface
*/ */
public $node; protected $node;
/** /**
* Count of how many times the form has been submitted. * Count of how many times the form has been submitted.
*
* @var int
*/ */
public $submit_count = 0; protected $submitCount = 0;
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
...@@ -44,7 +48,7 @@ protected function setUp() { ...@@ -44,7 +48,7 @@ protected function setUp() {
search_update_totals(); search_update_totals();
// Set up a dummy initial count of times the form has been submitted. // Set up a dummy initial count of times the form has been submitted.
$this->submit_count = \Drupal::state()->get('search_embedded_form.submit_count'); $this->submitCount = \Drupal::state()->get('search_embedded_form.submit_count');
$this->refreshVariables(); $this->refreshVariables();
} }
...@@ -58,8 +62,8 @@ function testEmbeddedForm() { ...@@ -58,8 +62,8 @@ function testEmbeddedForm() {
t('Send away')); t('Send away'));
$this->assertText(t('Test form was submitted'), 'Form message appears'); $this->assertText(t('Test form was submitted'), 'Form message appears');
$count = \Drupal::state()->get('search_embedded_form.submit_count'); $count = \Drupal::state()->get('search_embedded_form.submit_count');
$this->assertEqual($this->submit_count + 1, $count, 'Form submission count is correct'); $this->assertEqual($this->submitCount + 1, $count, 'Form submission count is correct');
$this->submit_count = $count; $this->submitCount = $count;
// Now verify that we can see and submit the form from the search results. // Now verify that we can see and submit the form from the search results.
$this->drupalGet('search/node', array('query' => array('keys' => $this->node->label()))); $this->drupalGet('search/node', array('query' => array('keys' => $this->node->label())));
...@@ -69,8 +73,8 @@ function testEmbeddedForm() { ...@@ -69,8 +73,8 @@ function testEmbeddedForm() {
t('Send away')); t('Send away'));
$this->assertText(t('Test form was submitted'), 'Form message appears'); $this->assertText(t('Test form was submitted'), 'Form message appears');
$count = \Drupal::state()->get('search_embedded_form.submit_count'); $count = \Drupal::state()->get('search_embedded_form.submit_count');
$this->assertEqual($this->submit_count + 1, $count, 'Form submission count is correct'); $this->assertEqual($this->submitCount + 1, $count, 'Form submission count is correct');
$this->submit_count = $count; $this->submitCount = $count;
// Now verify that if we submit the search form, it doesn't count as // Now verify that if we submit the search form, it doesn't count as
// our form being submitted. // our form being submitted.
...@@ -79,7 +83,7 @@ function testEmbeddedForm() { ...@@ -79,7 +83,7 @@ function testEmbeddedForm() {
t('Search')); t('Search'));
$this->assertNoText(t('Test form was submitted'), 'Form message does not appear'); $this->assertNoText(t('Test form was submitted'), 'Form message does not appear');
$count = \Drupal::state()->get('search_embedded_form.submit_count'); $count = \Drupal::state()->get('search_embedded_form.submit_count');
$this->assertEqual($this->submit_count, $count, 'Form submission count is correct'); $this->assertEqual($this->submitCount, $count, 'Form submission count is correct');
$this->submit_count = $count; $this->submitCount = $count;
} }
} }
...@@ -25,13 +25,20 @@ class SearchKeywordsConditionsTest extends SearchTestBase { ...@@ -25,13 +25,20 @@ class SearchKeywordsConditionsTest extends SearchTestBase {
*/ */
public static $modules = array('comment', 'search_extra_type'); public static $modules = array('comment', 'search_extra_type');
/**
* A user with permission to search and post comments.
*
* @var \Drupal\user\UserInterface
*/
protected $searchingUser;
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
// Create searching user. // Create searching user.
$this->searching_user = $this->drupalCreateUser(array('search content', 'access content', 'access comments', 'skip comment approval')); $this->searchingUser = $this->drupalCreateUser(array('search content', 'access content', 'access comments', 'skip comment approval'));
// Login with sufficient privileges. // Login with sufficient privileges.
$this->drupalLogin($this->searching_user); $this->drupalLogin($this->searchingUser);
} }
/** /**
......
...@@ -24,6 +24,13 @@ class SearchLanguageTest extends SearchTestBase { ...@@ -24,6 +24,13 @@ class SearchLanguageTest extends SearchTestBase {
*/ */
public static $modules = array('language'); public static $modules = array('language');
/**
* Array of nodes available to search.
*
* @var \Drupal\node\NodeInterface[]
*/
protected $searchableNodes;
protected function setUp() { protected function setUp() {
parent::setUp(); parent::setUp();
...@@ -63,20 +70,20 @@ protected function setUp() { ...@@ -63,20 +70,20 @@ protected function setUp() {
'langcode' => 'en', 'langcode' => 'en',
), ),
); );
$this->searchable_nodes = array(); $this->searchableNodes = [];
foreach ($nodes as $setting) { foreach ($nodes as $setting) {
$this->searchable_nodes[] = $this->drupalCreateNode($setting); $this->searchableNodes[] = $this->drupalCreateNode($setting);
} }
// Add English translation to the second node. // Add English translation to the second node.
$translation = $this->searchable_nodes[1]->addTranslation('en', array('title' => 'Second node en')); $translation = $this->searchableNodes[1]->addTranslation('en', array('title' => 'Second node en'));
$translation->body->value = $this->randomMachineName(32); $translation->body->value = $this->randomMachineName(32);
$this->searchable_nodes[1]->save(); $this->searchableNodes[1]->save();
// Add Spanish translation to the third node. // Add Spanish translation to the third node.
$translation = $this->searchable_nodes[2]->addTranslation('es', array('title' => 'Third node es')); $translation = $this->searchableNodes[2]->addTranslation('es', array('title' => 'Third node es'));
$translation->body->value = $this->randomMachineName(32); $translation->body->value = $this->randomMachineName(32);
$this->searchable_nodes[2]->save(); $this->searchableNodes[2]->save();
// Update the index and then run the shutdown method. // Update the index and then run the shutdown method.
$plugin = $this->container->get('plugin.manager.search')->createInstance('node_search'); $plugin = $this->container->get('plugin.manager.search')->createInstance('node_search');
......
...@@ -20,9 +20,9 @@ class SearchMultilingualEntityTest extends SearchTestBase { ...@@ -20,9 +20,9 @@ class SearchMultilingualEntityTest extends SearchTestBase {
/** /**
* List of searchable nodes. * List of searchable nodes.
* *
* @var array * @var \Drupal\node\NodeInterface[]
*/ */
protected $searchable_nodes = array(); protected $searchableNodes = array();
/** /**
* Node search plugin. * Node search plugin.
...@@ -97,22 +97,22 @@ protected function setUp() { ...@@ -97,22 +97,22 @@ protected function setUp() {
array( array(
), ),
); );
$this->searchable_nodes = array(); $this->searchableNodes = array();
foreach ($nodes as $setting) { foreach ($nodes as $setting) {
$this->searchable_nodes[] = $this->drupalCreateNode($setting); $this->searchableNodes[] = $this->drupalCreateNode($setting);
} }
// Add a single translation to the second node. // Add a single translation to the second node.
$translation = $this->searchable_nodes[1]->addTranslation('hu', array('title' => 'Second node hu')); $translation = $this->searchableNodes[1]->addTranslation('hu', array('title' => 'Second node hu'));
$translation->body->value = $this->randomMachineName(32); $translation->body->value = $this->randomMachineName(32);
$this->searchable_nodes[1]->save(); $this->searchableNodes[1]->save();
// Add two translations to the third node. // Add two translations to the third node.
$translation = $this->searchable_nodes[2]->addTranslation('hu', array('title' => 'Third node this is the Hungarian title')); $translation = $this->searchableNodes[2]->addTranslation('hu', array('title' => 'Third node this is the Hungarian title'));
$translation->body->value = $this->randomMachineName(32); $translation->body->value = $this->randomMachineName(32);
$translation = $this->searchable_nodes[2]->addTranslation('sv', array('title' => 'Third node sv')); $translation = $this->searchableNodes[2]->addTranslation('sv', array('title' => 'Third node sv'));
$translation->body->value = $this->randomMachineName(32); $translation->body->value = $this->randomMachineName(32);
$this->searchable_nodes[2]->save(); $this->searchableNodes[2]->save();
// Verify that we have 8 nodes left to do. // Verify that we have 8 nodes left to do.
$this->assertIndexCounts(8, 8, 'before updating the search index');