You are here

protected function IntegrationTest::checkPluginCacheClear in Search API Autocomplete 8

Verifies that creating or deleting a view clears the search plugin cache.

1 call to IntegrationTest::checkPluginCacheClear()
IntegrationTest::testModule in tests/src/FunctionalJavascript/IntegrationTest.php
Tests the complete functionality of the module via the UI.

File

tests/src/FunctionalJavascript/IntegrationTest.php, line 438

Class

IntegrationTest
Tests the functionality of the whole module from a user's perspective.

Namespace

Drupal\Tests\search_api_autocomplete\FunctionalJavascript

Code

protected function checkPluginCacheClear() {
  $assert_session = $this
    ->assertSession();
  $new_view_label = 'Search plugin cache test';
  $this
    ->drupalGet($this
    ->getAdminPath());
  $assert_session
    ->pageTextNotContains($new_view_label);
  $view = View::load('search_api_autocomplete_test_view')
    ->createDuplicate();
  $view
    ->set('id', 'search_plugin_cache_test');
  $view
    ->set('label', $new_view_label);
  $display = $view
    ->get('display');
  $display['page']['display_options']['path'] = 'some/new/path';
  $view
    ->set('display', $display);
  $view
    ->save();
  $this
    ->drupalGet($this
    ->getAdminPath());
  $assert_session
    ->pageTextContains($new_view_label);
  $view
    ->delete();
  $this
    ->drupalGet($this
    ->getAdminPath());
  $assert_session
    ->pageTextNotContains($new_view_label);
}