protected function IntegrationTest::checkHooks in Search API Autocomplete 8
Checks that the module's hooks work as expected.
1 call to IntegrationTest::checkHooks()
- 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 406
Class
- IntegrationTest
- Tests the functionality of the whole module from a user's perspective.
Namespace
Drupal\Tests\search_api_autocomplete\FunctionalJavascriptCode
protected function checkHooks() {
$assert_session = $this
->assertSession();
\Drupal::getContainer()
->get('module_installer')
->install([
'search_api_autocomplete_test_hooks',
]);
$this
->drupalGet($this
->getAdminPath());
$assert_session
->pageTextContains('The Siren');
$assert_session
->pageTextContains('Planet Hell');
$assert_session
->pageTextNotContains('Search views');
$assert_session
->pageTextNotContains('Searches provided by Views');
$this
->drupalGet($this
->getAdminPath('edit'));
$assert_session
->pageTextContains('Wish I Had an Angel');
$assert_session
->pageTextNotContains('Test suggester');
$this
->drupalGet('search-api-autocomplete-test');
$assert_session
->pageTextContains("Creek Mary's Blood");
$autocomplete_path = "search_api_autocomplete/{$this->searchId}";
$this
->drupalGet($autocomplete_path, [
'query' => [
'q' => 'test',
],
]);
$assert_session
->responseContains('dark chest of wonders');
\Drupal::getContainer()
->get('module_installer')
->uninstall([
'search_api_autocomplete_test_hooks',
]);
}