diff --git a/src/Tests/HooksTest.php b/src/Tests/HooksTest.php index a48067a..c3f3ffe 100644 --- a/src/Tests/HooksTest.php +++ b/src/Tests/HooksTest.php @@ -8,9 +8,7 @@ namespace Drupal\search_api\Tests; use Drupal\Component\Utility\Unicode; -use Drupal\search_api\Entity\Index; -use Drupal\search_api\Entity\Server; -use Drupal\search_api\SearchApiException; +use Drupal\Core\Url; /** * Tests integration of hooks. @@ -39,19 +37,11 @@ class HooksTest extends WebTestBase { protected $indexId; /** - * {@inheritdoc} - */ - public function setUp() { - parent::setUp(); - $this->indexStorage = \Drupal::entityManager()->getStorage('search_api_index'); - } - - /** * Tests various operations via the Search API's admin UI. */ public function testHooks() { - $server_add_form = $this->urlGenerator->generateFromRoute('entity.search_api_server.add_form', array(), array('absolute' => TRUE)); - $index_add_form = $this->urlGenerator->generateFromRoute('entity.search_api_index.add_form', array(), array('absolute' => TRUE)); + $server_add_form = new Url('entity.search_api_server.add_form', array(), array('absolute' => TRUE)); + $index_add_form = new Url('entity.search_api_index.add_form', array(), array('absolute' => TRUE)); // Create some nodes. $this->drupalCreateNode(array('type' => 'page')); @@ -114,9 +104,9 @@ class HooksTest extends WebTestBase { */ protected function createServer() { $this->serverId = Unicode::strtolower($this->randomMachineName()); - $settings_path = $this->urlGenerator->generateFromRoute('entity.search_api_server.add_form', array(), array('absolute' => TRUE)); + $server_add_form = new Url('entity.search_api_server.add_form', array(), array('absolute' => TRUE)); - $this->drupalGet($settings_path); + $this->drupalGet($server_add_form); $edit = array( 'name' => 'Search API test server', @@ -136,9 +126,9 @@ class HooksTest extends WebTestBase { * Creates an index. */ protected function createIndex() { - $settings_path = $this->urlGenerator->generateFromRoute('entity.search_api_index.add_form', array(), array('absolute' => TRUE)); + $index_add_form = new Url('entity.search_api_index.add_form', array(), array('absolute' => TRUE)); - $this->drupalGet($settings_path); + $this->drupalGet($index_add_form); $this->indexId = 'test_index'; diff --git a/tests/search_api_test_hooks/search_api_test_hooks.info.yml b/tests/search_api_test_hooks/search_api_test_hooks.info.yml index f05b43b..55f6462 100644 --- a/tests/search_api_test_hooks/search_api_test_hooks.info.yml +++ b/tests/search_api_test_hooks/search_api_test_hooks.info.yml @@ -5,4 +5,4 @@ package: Testing dependencies: - search_api:search_api core: 8.x -#hidden: true +hidden: true diff --git a/tests/search_api_test_hooks/search_api_test_hooks.module b/tests/search_api_test_hooks/search_api_test_hooks.module index 254d6e4..44a830f 100644 --- a/tests/search_api_test_hooks/search_api_test_hooks.module +++ b/tests/search_api_test_hooks/search_api_test_hooks.module @@ -2,7 +2,7 @@ /** * @file - * Test all the hooks defined by search api. + * Tests all the hooks defined by the Search API module. */ /**