You are here

public function LinkitsearchPluginNodeTestCase::testDescription in Linkit 7.3

Test result description.

We just test one token.

File

test/linkit_search_plugin_node.test, line 158
Tests for Linkit search plugin node.

Class

LinkitsearchPluginNodeTestCase
Test the the node search plugin.

Code

public function testDescription() {

  // Create some nodes.
  $node_1 = $this
    ->drupalCreateNode(array(
    'type' => 'article',
    'title' => $this->search_string . $this
      ->randomName(),
  ));
  $node_2 = $this
    ->drupalCreateNode(array(
    'type' => 'page',
    'title' => $this->search_string . $this
      ->randomName(),
  ));

  // Update the profile with a user result description.
  $this->_profile->data['entity:node']['result_description'] = 'Created [node:created:raw]';
  $this
    ->updateProfile();

  // Call the autocomplete helper method.
  $this
    ->autocompleteCall();

  // Check that the result description appers in the result.
  $this
    ->assertRaw('Created ' . $node_1->created, 'The result description was found in the result array.');
  $this
    ->assertRaw('Created ' . $node_2->created, 'The result description was found in the result array.');
}