diff --git a/src/Tests/HooksTest.php b/src/Tests/HooksTest.php index c3f3ffe..9e1a1a4 100644 --- a/src/Tests/HooksTest.php +++ b/src/Tests/HooksTest.php @@ -8,7 +8,6 @@ namespace Drupal\search_api\Tests; use Drupal\Component\Utility\Unicode; -use Drupal\Core\Url; /** * Tests integration of hooks. @@ -40,9 +39,6 @@ class HooksTest extends WebTestBase { * Tests various operations via the Search API's admin UI. */ public function testHooks() { - $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')); $this->drupalCreateNode(array('type' => 'page')); @@ -56,11 +52,11 @@ class HooksTest extends WebTestBase { $this->createIndex(); // hook_search_api_backend_info_alter was triggered. - $this->drupalGet($server_add_form); + $this->drupalGet('admin/config/search/search-api/add-server'); $this->assertText('Slims return'); // hook_search_api_datasource_info_alter was triggered. - $this->drupalGet($index_add_form); + $this->drupalGet('admin/config/search/search-api/add-index'); $this->assertText('Distant land'); // hook_search_api_processor_info_alter was triggered. @@ -104,9 +100,8 @@ class HooksTest extends WebTestBase { */ protected function createServer() { $this->serverId = Unicode::strtolower($this->randomMachineName()); - $server_add_form = new Url('entity.search_api_server.add_form', array(), array('absolute' => TRUE)); - $this->drupalGet($server_add_form); + $this->drupalGet('admin/config/search/search-api/add-server'); $edit = array( 'name' => 'Search API test server', @@ -126,9 +121,7 @@ class HooksTest extends WebTestBase { * Creates an index. */ protected function createIndex() { - $index_add_form = new Url('entity.search_api_index.add_form', array(), array('absolute' => TRUE)); - - $this->drupalGet($index_add_form); + $this->drupalGet('admin/config/search/search-api/add-index'); $this->indexId = 'test_index';