You are here

protected function IntegrationTest::checkProcessorChanges in Search API 8

Tests that changing or a processor doesn't always trigger reindexing.

2 calls to IntegrationTest::checkProcessorChanges()
IntegrationTest::testFramework in tests/src/Functional/IntegrationTest.php
Tests various operations via the Search API's admin UI.
IntegrationTest::testIntegerIndex in tests/src/Functional/IntegrationTest.php
Tests what happens when an index has an integer as id/label.

File

tests/src/Functional/IntegrationTest.php, line 1225

Class

IntegrationTest
Tests the overall functionality of the Search API framework and admin UI.

Namespace

Drupal\Tests\search_api\Functional

Code

protected function checkProcessorChanges() {
  $edit = [
    'status[ignorecase]' => 1,
    'processors[ignorecase][settings][fields][title]' => 'title',
  ];

  // Enable just the ignore case processor, just to have a clean default state
  // before testing.
  $this
    ->drupalGet($this
    ->getIndexPath('processors'));
  $this
    ->submitForm($edit, 'Save');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->submitForm($edit, 'Save');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->pageTextContains('No values were changed.');
  $this
    ->assertSession()
    ->pageTextNotContains('All content was scheduled for reindexing so the new settings can take effect.');
  $edit['processors[ignorecase][settings][fields][title]'] = FALSE;
  $this
    ->submitForm($edit, 'Save');
  $this
    ->assertSession()
    ->statusCodeEquals(200);
  $this
    ->assertSession()
    ->pageTextContains('All content was scheduled for reindexing so the new settings can take effect.');
  $this
    ->assertSession()
    ->responseContains($this
    ->getIndex()
    ->toUrl('canonical')
    ->toString());
}