diff --git a/modules/search_api_db/search_api_db.info.yml b/modules/search_api_db/search_api_db.info.yml
index f23f610c..eac60c01 100644
--- a/modules/search_api_db/search_api_db.info.yml
+++ b/modules/search_api_db/search_api_db.info.yml
@@ -2,6 +2,6 @@ type: module
 name: Database Search
 description: Offers an implementation of the Search API that uses database tables for indexing content.
 package: Search
-core: 8.x
+core_version_requirement: ^8.8 || ^9
 dependencies:
   - search_api:search_api
diff --git a/modules/search_api_db/search_api_db_defaults/search_api_db_defaults.info.yml b/modules/search_api_db/search_api_db_defaults/search_api_db_defaults.info.yml
index 6d1f8052..fb0c1727 100644
--- a/modules/search_api_db/search_api_db_defaults/search_api_db_defaults.info.yml
+++ b/modules/search_api_db/search_api_db_defaults/search_api_db_defaults.info.yml
@@ -2,7 +2,7 @@ type: module
 name: Database Search Defaults
 description: Enable this module for a best-practice default setup of Search API with the Database backend. After installation it is recommended to uninstall this module again for performance reasons. The provided configuration will not be removed.
 package: Search
-core: 8.x
+core_version_requirement: ^8.8 || ^9
 dependencies:
   - drupal:comment
   - drupal:field
diff --git a/modules/search_api_db/src/Tests/Update/SearchApiDbUpdate8102Test.php b/modules/search_api_db/src/Tests/Update/SearchApiDbUpdate8102Test.php
index 25cd8d1f..5b6a2eb0 100644
--- a/modules/search_api_db/src/Tests/Update/SearchApiDbUpdate8102Test.php
+++ b/modules/search_api_db/src/Tests/Update/SearchApiDbUpdate8102Test.php
@@ -44,7 +44,7 @@ class SearchApiDbUpdate8102Test extends UpdatePathTestBase {
    */
   protected function setDatabaseDumpFiles() {
     $this->databaseDumpFiles = [
-      DRUPAL_ROOT . '/core/modules/system/tests/fixtures/update/drupal-8.bare.standard.php.gz',
+      DRUPAL_ROOT . '/core/modules/system/tests/fixtures/update/drupal-8.8.0.bare.standard.php.gz',
       __DIR__ . '/../../../tests/fixtures/update/search-api-db-base.php',
       __DIR__ . '/../../../tests/fixtures/update/search-api-db-update-8102.php',
     ];
diff --git a/modules/search_api_db/tests/search_api_db_test_autocomplete/search_api_db_test_autocomplete.info.yml b/modules/search_api_db/tests/search_api_db_test_autocomplete/search_api_db_test_autocomplete.info.yml
index 311539a6..5266cf1b 100644
--- a/modules/search_api_db/tests/search_api_db_test_autocomplete/search_api_db_test_autocomplete.info.yml
+++ b/modules/search_api_db/tests/search_api_db_test_autocomplete/search_api_db_test_autocomplete.info.yml
@@ -5,5 +5,5 @@ package: Testing
 dependencies:
   - search_api:search_api_test_views
   - search_api_autocomplete:search_api_autocomplete
-core: 8.x
+core_version_requirement: ^8.8 || ^9
 hidden: true
diff --git a/modules/search_api_db/tests/src/FunctionalJavascript/IntegrationTest.php b/modules/search_api_db/tests/src/FunctionalJavascript/IntegrationTest.php
index 8e2046c2..f3606107 100644
--- a/modules/search_api_db/tests/src/FunctionalJavascript/IntegrationTest.php
+++ b/modules/search_api_db/tests/src/FunctionalJavascript/IntegrationTest.php
@@ -19,6 +19,13 @@ class IntegrationTest extends WebDriverTestBase {
     'search_api_db',
   ];
 
+  /**
+   * The theme to install as the default for testing.
+   *
+   * @var string
+   */
+  protected $defaultTheme = 'stark';
+
   /**
    * Tests that adding a server works.
    */
diff --git a/search_api.info.yml b/search_api.info.yml
index 2cfb9aab..dc4a7c4c 100644
--- a/search_api.info.yml
+++ b/search_api.info.yml
@@ -2,7 +2,5 @@ type: module
 name: 'Search API'
 description: 'Provides a generic framework for modules offering search capabilities.'
 package: Search
-core: 8.x
+core_version_requirement: ^8.8 || ^9
 configure: search_api.overview
-dependencies:
-  - drupal:system (>=8.7.4)
diff --git a/src/Plugin/PluginFormTrait.php b/src/Plugin/PluginFormTrait.php
index 7ccd7a23..e9bb8ec8 100644
--- a/src/Plugin/PluginFormTrait.php
+++ b/src/Plugin/PluginFormTrait.php
@@ -3,6 +3,7 @@
 namespace Drupal\search_api\Plugin;
 
 use Drupal\Component\Plugin\ConfigurableInterface;
+use Drupal\Component\Plugin\ConfigurablePluginInterface as DrupalConfigurablePluginInterface;
 use Drupal\Core\Form\FormStateInterface;
 
 /**
@@ -38,7 +39,8 @@ trait PluginFormTrait {
    * @see \Drupal\Core\Plugin\PluginFormInterface::submitConfigurationForm()
    */
   public function submitConfigurationForm(array &$form, FormStateInterface $form_state) {
-    if ($this instanceof ConfigurableInterface) {
+    // @todo Clean this up once we depend on Drupal 9.0+.
+    if ($this instanceof ConfigurableInterface || $this instanceof DrupalConfigurablePluginInterface) {
       $this->setConfiguration($form_state->getValues());
     }
   }
diff --git a/src/Plugin/views/field/SearchApiEntity.php b/src/Plugin/views/field/SearchApiEntity.php
index 84b0bcee..812b2b4d 100644
--- a/src/Plugin/views/field/SearchApiEntity.php
+++ b/src/Plugin/views/field/SearchApiEntity.php
@@ -230,7 +230,7 @@ class SearchApiEntity extends SearchApiStandard {
       return;
     }
 
-    $entities = $this->getEntityManager()
+    $entities = $this->getEntityTypeManager()
       ->getStorage($this->getTargetEntityTypeId())
       ->loadMultiple(array_keys($to_load));
     $account = $this->getQuery()->getAccessAccount();
@@ -316,7 +316,7 @@ class SearchApiEntity extends SearchApiStandard {
     }
 
     $view_mode = $this->options['display_methods'][$bundle]['view_mode'];
-    $build = $this->getEntityManager()
+    $build = $this->getEntityFieldManager()
       ->getViewBuilder($entity->getEntityTypeId())
       ->view($entity, $view_mode);
     return [
diff --git a/src/Processor/FieldsProcessorPluginBase.php b/src/Processor/FieldsProcessorPluginBase.php
index eb857fab..b06c1f7c 100644
--- a/src/Processor/FieldsProcessorPluginBase.php
+++ b/src/Processor/FieldsProcessorPluginBase.php
@@ -7,6 +7,7 @@ use Drupal\Core\Form\FormStateInterface;
 use Drupal\Core\Plugin\PluginFormInterface;
 use Drupal\Core\Render\Element;
 use Drupal\Core\Render\ElementInfoManagerInterface;
+use Drupal\Core\Security\TrustedCallbackInterface;
 use Drupal\search_api\Item\FieldInterface;
 use Drupal\search_api\Utility\DataTypeHelperInterface;
 use Drupal\search_api\Plugin\PluginFormTrait;
@@ -41,7 +42,7 @@ use Symfony\Component\DependencyInjection\ContainerInterface;
  * - preprocess_index
  * - preprocess_query
  */
-abstract class FieldsProcessorPluginBase extends ProcessorPluginBase implements PluginFormInterface {
+abstract class FieldsProcessorPluginBase extends ProcessorPluginBase implements PluginFormInterface, TrustedCallbackInterface {
 
   use PluginFormTrait;
 
@@ -118,6 +119,13 @@ abstract class FieldsProcessorPluginBase extends ProcessorPluginBase implements
     return $this;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public static function trustedCallbacks() {
+    return ['preRenderFieldsCheckboxes'];
+  }
+
   /**
    * {@inheritdoc}
    */
diff --git a/tests/search_api_test/search_api_test.info.yml b/tests/search_api_test/search_api_test.info.yml
index fa1580ac..739ebf8f 100644
--- a/tests/search_api_test/search_api_test.info.yml
+++ b/tests/search_api_test/search_api_test.info.yml
@@ -4,5 +4,5 @@ description: 'Support module for Search API tests'
 package: Testing
 dependencies:
   - search_api:search_api
-core: 8.x
+core_version_requirement: ^8.8 || ^9
 hidden: true
diff --git a/tests/search_api_test_db/search_api_test_db.info.yml b/tests/search_api_test_db/search_api_test_db.info.yml
index a02a1548..e9011ad5 100644
--- a/tests/search_api_test_db/search_api_test_db.info.yml
+++ b/tests/search_api_test_db/search_api_test_db.info.yml
@@ -5,5 +5,5 @@ package: Testing
 dependencies:
   - search_api:search_api_db
   - search_api:search_api_test_example_content
-core: 8.x
+core_version_requirement: ^8.8 || ^9
 hidden: true
diff --git a/tests/search_api_test_events/search_api_test_events.info.yml b/tests/search_api_test_events/search_api_test_events.info.yml
index 63360461..23a23ac7 100644
--- a/tests/search_api_test_events/search_api_test_events.info.yml
+++ b/tests/search_api_test_events/search_api_test_events.info.yml
@@ -4,5 +4,5 @@ description: 'Support module for Search API tests, tests all events.'
 package: Testing
 dependencies:
   - search_api:search_api
-core: 8.x
+core_version_requirement: ^8.8 || ^9
 hidden: true
diff --git a/tests/search_api_test_example_content/search_api_test_example_content.info.yml b/tests/search_api_test_example_content/search_api_test_example_content.info.yml
index a2134767..fe9696a4 100644
--- a/tests/search_api_test_example_content/search_api_test_example_content.info.yml
+++ b/tests/search_api_test_example_content/search_api_test_example_content.info.yml
@@ -4,5 +4,5 @@ description: 'Provides field definitions for example content.'
 package: Testing
 dependencies:
   - drupal:entity_test
-core: 8.x
+core_version_requirement: ^8.8 || ^9
 hidden: true
diff --git a/tests/search_api_test_excerpt_field/search_api_test_excerpt_field.info.yml b/tests/search_api_test_excerpt_field/search_api_test_excerpt_field.info.yml
index 7c3cf4dd..ccb5fa99 100644
--- a/tests/search_api_test_excerpt_field/search_api_test_excerpt_field.info.yml
+++ b/tests/search_api_test_excerpt_field/search_api_test_excerpt_field.info.yml
@@ -6,5 +6,5 @@ dependencies:
   - search_api:search_api
   - search_api:search_api_test_db
   - drupal:views
-core: 8.x
+core_version_requirement: ^8.8 || ^9
 hidden: true
diff --git a/tests/search_api_test_extraction/search_api_test_extraction.info.yml b/tests/search_api_test_extraction/search_api_test_extraction.info.yml
index 11a7cfad..fdef214c 100644
--- a/tests/search_api_test_extraction/search_api_test_extraction.info.yml
+++ b/tests/search_api_test_extraction/search_api_test_extraction.info.yml
@@ -4,5 +4,5 @@ description: 'Provides a setup for testing field values extraction.'
 package: Testing
 dependencies:
   - drupal:entity_test
-core: 8.x
+core_version_requirement: ^8.8 || ^9
 hidden: true
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 55f64622..c556cd59 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
@@ -4,5 +4,5 @@ description: 'Support module for Search API tests, tests all the hooks.'
 package: Testing
 dependencies:
   - search_api:search_api
-core: 8.x
+core_version_requirement: ^8.8 || ^9
 hidden: true
diff --git a/tests/search_api_test_inconsistent_config/search_api_test_inconsistent_config.info.yml b/tests/search_api_test_inconsistent_config/search_api_test_inconsistent_config.info.yml
index 70ab9767..ceee2f6c 100644
--- a/tests/search_api_test_inconsistent_config/search_api_test_inconsistent_config.info.yml
+++ b/tests/search_api_test_inconsistent_config/search_api_test_inconsistent_config.info.yml
@@ -5,5 +5,5 @@ package: Testing
 dependencies:
   - search_api:search_api
   - search_api:search_api_test
-core: 8.x
+core_version_requirement: ^8.8 || ^9
 hidden: true
diff --git a/tests/search_api_test_language_fallback/search_api_test_language_fallback.info.yml b/tests/search_api_test_language_fallback/search_api_test_language_fallback.info.yml
index 9d255d26..844d6549 100644
--- a/tests/search_api_test_language_fallback/search_api_test_language_fallback.info.yml
+++ b/tests/search_api_test_language_fallback/search_api_test_language_fallback.info.yml
@@ -2,5 +2,5 @@ type: module
 name: 'Language Fallback Test'
 description: 'Provides a language fallback fr => es.'
 package: 'Search API'
-core: 8.x
+core_version_requirement: ^8.8 || ^9
 hidden: true
diff --git a/tests/search_api_test_no_ui/search_api_test_no_ui.info.yml b/tests/search_api_test_no_ui/search_api_test_no_ui.info.yml
index ffce8020..4e730600 100644
--- a/tests/search_api_test_no_ui/search_api_test_no_ui.info.yml
+++ b/tests/search_api_test_no_ui/search_api_test_no_ui.info.yml
@@ -4,5 +4,5 @@ description: 'Support module for Search API tests ("No UI" plugins)'
 package: Testing
 dependencies:
   - search_api:search_api
-core: 8.x
+core_version_requirement: ^8.8 || ^9
 hidden: true
diff --git a/tests/search_api_test_node_indexing/search_api_test_node_indexing.info.yml b/tests/search_api_test_node_indexing/search_api_test_node_indexing.info.yml
index 10cdc56f..ee978fb2 100644
--- a/tests/search_api_test_node_indexing/search_api_test_node_indexing.info.yml
+++ b/tests/search_api_test_node_indexing/search_api_test_node_indexing.info.yml
@@ -4,5 +4,5 @@ description: 'Test module for testing indexing of nodes in Search API.'
 package: 'Search API'
 dependencies:
   - search_api:search_api_db
-core: 8.x
+core_version_requirement: ^8.8 || ^9
 hidden: true
diff --git a/tests/search_api_test_tasks/search_api_test_tasks.info.yml b/tests/search_api_test_tasks/search_api_test_tasks.info.yml
index ac6cc1e6..a9727b6f 100644
--- a/tests/search_api_test_tasks/search_api_test_tasks.info.yml
+++ b/tests/search_api_test_tasks/search_api_test_tasks.info.yml
@@ -4,5 +4,5 @@ description: 'Support module for tests of the Search API tasks system.'
 package: Testing
 dependencies:
   - search_api:search_api
-core: 8.x
+core_version_requirement: ^8.8 || ^9
 hidden: true
diff --git a/tests/search_api_test_views/search_api_test_views.info.yml b/tests/search_api_test_views/search_api_test_views.info.yml
index 49e133b6..3c8c2283 100644
--- a/tests/search_api_test_views/search_api_test_views.info.yml
+++ b/tests/search_api_test_views/search_api_test_views.info.yml
@@ -8,5 +8,5 @@ dependencies:
   - drupal:node
   - drupal:rest
   - drupal:views
-core: 8.x
+core_version_requirement: ^8.8 || ^9
 hidden: true
diff --git a/tests/src/Functional/AddServerFormTest.php b/tests/src/Functional/AddServerFormTest.php
index 977c45f5..cf221d3e 100644
--- a/tests/src/Functional/AddServerFormTest.php
+++ b/tests/src/Functional/AddServerFormTest.php
@@ -20,6 +20,13 @@ class AddServerFormTest extends BrowserTestBase {
     'search_api',
   ];
 
+  /**
+   * The theme to install as the default for testing.
+   *
+   * @var string
+   */
+  protected $defaultTheme = 'stark';
+
   /**
    * {@inheritdoc}
    */
diff --git a/tests/src/Functional/CacheabilityTest.php b/tests/src/Functional/CacheabilityTest.php
index f8ebdfd5..256df279 100644
--- a/tests/src/Functional/CacheabilityTest.php
+++ b/tests/src/Functional/CacheabilityTest.php
@@ -76,8 +76,8 @@ class CacheabilityTest extends SearchApiBrowserTestBase {
       $this->fail($e->getMessage());
     }
     Block::create([
-      'id' => 'classy_local_actions',
-      'theme' => 'classy',
+      'id' => 'stark_local_actions',
+      'theme' => 'stark',
       'weight' => -20,
       'plugin' => 'local_actions_block',
       'region' => 'content',
diff --git a/tests/src/Functional/IntegrationTest.php b/tests/src/Functional/IntegrationTest.php
index 46723fce..151e8f49 100644
--- a/tests/src/Functional/IntegrationTest.php
+++ b/tests/src/Functional/IntegrationTest.php
@@ -903,8 +903,9 @@ class IntegrationTest extends SearchApiBrowserTestBase {
    */
   protected function checkDataTypesTable() {
     $this->drupalGet($this->getIndexPath('fields'));
-    $rows = $this->xpath('//*[@id="search-api-data-types-table"]/*/table/tbody/tr');
-    $this->assertTrue(is_array($rows) && !empty($rows), 'Found a datatype listing.');
+    $rows = $this->xpath('//*[@id="search-api-data-types-table"]//table/tbody/tr');
+    $this->assertInternalType('array', $rows);
+    $this->assertNotEmpty($rows);
 
     /** @var \Behat\Mink\Element\NodeElement $row */
     foreach ($rows as $row) {
diff --git a/tests/src/Functional/OverviewPageTest.php b/tests/src/Functional/OverviewPageTest.php
index b07a06dd..95826c75 100644
--- a/tests/src/Functional/OverviewPageTest.php
+++ b/tests/src/Functional/OverviewPageTest.php
@@ -66,8 +66,8 @@ class OverviewPageTest extends SearchApiBrowserTestBase {
     // Enable the "Local actions" block so we can verify which local actions are
     // displayed.
     Block::create([
-      'id' => 'classy_local_actions',
-      'theme' => 'classy',
+      'id' => 'local_actions',
+      'theme' => $this->defaultTheme,
       'weight' => -20,
       'plugin' => 'local_actions_block',
       'region' => 'content',
diff --git a/tests/src/Functional/SearchApiBrowserTestBase.php b/tests/src/Functional/SearchApiBrowserTestBase.php
index e0ad8dd9..979f54f8 100644
--- a/tests/src/Functional/SearchApiBrowserTestBase.php
+++ b/tests/src/Functional/SearchApiBrowserTestBase.php
@@ -25,6 +25,13 @@ abstract class SearchApiBrowserTestBase extends BrowserTestBase {
     'search_api_test',
   ];
 
+  /**
+   * The theme to install as the default for testing.
+   *
+   * @var string
+   */
+  protected $defaultTheme = 'stark';
+
   /**
    * Set this to TRUE to include "item" and "article" bundles for test entities.
    *
diff --git a/tests/src/Functional/ViewsTest.php b/tests/src/Functional/ViewsTest.php
index 09f8b1da..093ced3b 100644
--- a/tests/src/Functional/ViewsTest.php
+++ b/tests/src/Functional/ViewsTest.php
@@ -418,7 +418,7 @@ class ViewsTest extends SearchApiBrowserTestBase {
 
     Block::create([
       'id' => 'search_api_test_view',
-      'theme' => 'classy',
+      'theme' => $this->defaultTheme,
       'weight' => -20,
       'plugin' => 'views_exposed_filter_block:search_api_test_view-page_1',
       'region' => 'content',
diff --git a/tests/src/FunctionalJavascript/AjaxTest.php b/tests/src/FunctionalJavascript/AjaxTest.php
index b0d96b7f..5465091f 100644
--- a/tests/src/FunctionalJavascript/AjaxTest.php
+++ b/tests/src/FunctionalJavascript/AjaxTest.php
@@ -29,6 +29,11 @@ class AjaxTest extends WebDriverTestBase {
     'image',
   ];
 
+  /**
+   * {@inheritdoc}
+   */
+  protected $defaultTheme = 'stark';
+
   /**
    * {@inheritdoc}
    */
diff --git a/tests/src/Kernel/Processor/AddHierarchyTest.php b/tests/src/Kernel/Processor/AddHierarchyTest.php
index e1adf791..86163f40 100644
--- a/tests/src/Kernel/Processor/AddHierarchyTest.php
+++ b/tests/src/Kernel/Processor/AddHierarchyTest.php
@@ -9,7 +9,7 @@ use Drupal\search_api\Item\Field;
 use Drupal\search_api\Query\Query;
 use Drupal\Tests\node\Traits\NodeCreationTrait;
 use Drupal\Tests\search_api\Kernel\ResultsTrait;
-use Drupal\Tests\taxonomy\Functional\TaxonomyTestTrait;
+use Drupal\Tests\taxonomy\Traits\TaxonomyTestTrait;
 
 /**
  * Tests the "Hierarchy" processor.
diff --git a/tests/src/Kernel/Processor/RenderedItemTest.php b/tests/src/Kernel/Processor/RenderedItemTest.php
index 28e6723d..f547d3dd 100644
--- a/tests/src/Kernel/Processor/RenderedItemTest.php
+++ b/tests/src/Kernel/Processor/RenderedItemTest.php
@@ -49,6 +49,7 @@ class RenderedItemTest extends ProcessorTestBase {
     'comment',
     'system',
     'filter',
+    'path_alias'
   ];
 
   /**
@@ -57,13 +58,10 @@ class RenderedItemTest extends ProcessorTestBase {
   public function setUp($processor = NULL) {
     parent::setUp('rendered_item');
 
-    // Drupal 8.8 converted path aliases to entities, which means there will be
-    // one more entity type enabled by default (which we need to install for
-    // this test, to make sure the processor breaks for none of them).
-    // @todo Remove if once we depend on Drupal 8.8+.
-    if (\Drupal::entityTypeManager()->hasDefinition('path_alias')) {
-      $this->installEntitySchema('path_alias');
-    }
+    // Enable the optional "path_alias" entity type as well to make sure the
+    // processor doesn't break for any of the default types.
+    $this->installEntitySchema('path_alias');
+
     // Load additional configuration and needed schemas. (The necessary schemas
     // for using nodes are already installed by the parent method.)
     $this->installConfig(['system', 'filter', 'node', 'comment', 'user']);
diff --git a/tests/src/Kernel/System/CommandHelperTest.php b/tests/src/Kernel/System/CommandHelperTest.php
index 24399797..266ad9de 100644
--- a/tests/src/Kernel/System/CommandHelperTest.php
+++ b/tests/src/Kernel/System/CommandHelperTest.php
@@ -176,7 +176,7 @@ class CommandHelperTest extends KernelTestBase {
     $index = Index::load('second_index');
     $this->assertTrue($index->status());
 
-    $this->setExpectedException(ConsoleException::class);
+    $this->expectException(ConsoleException::class);
     $this->systemUnderTest->enableIndexCommand(['foo']);
   }
 
@@ -192,7 +192,7 @@ class CommandHelperTest extends KernelTestBase {
       $index->delete();
     }
 
-    $this->setExpectedException(ConsoleException::class);
+    $this->expectException(ConsoleException::class);
     $this->systemUnderTest->enableIndexCommand(['second_index']);
   }
 
@@ -222,7 +222,7 @@ class CommandHelperTest extends KernelTestBase {
     $index = Index::load('test_index');
     $this->assertFalse($index->status());
 
-    $this->setExpectedException(ConsoleException::class);
+    $this->expectException(ConsoleException::class);
     $this->systemUnderTest->disableIndexCommand(['foo']);
   }
 
@@ -299,7 +299,7 @@ class CommandHelperTest extends KernelTestBase {
     $this->assertSame('disabled', (string) $result['test_server']['status']);
 
     $server->delete();
-    $this->setExpectedException(ConsoleException::class);
+    $this->expectException(ConsoleException::class);
     $this->systemUnderTest->serverListCommand();
   }
 
@@ -318,7 +318,7 @@ class CommandHelperTest extends KernelTestBase {
     $server = Server::load('test_server');
     $this->assertTrue($server->status());
 
-    $this->setExpectedException(ConsoleException::class);
+    $this->expectException(ConsoleException::class);
     $this->systemUnderTest->enableServerCommand('foo');
   }
 
@@ -333,7 +333,7 @@ class CommandHelperTest extends KernelTestBase {
     $server = Server::load('test_server');
     $this->assertFalse($server->status());
 
-    $this->setExpectedException(ConsoleException::class);
+    $this->expectException(ConsoleException::class);
     $this->systemUnderTest->enableServerCommand('foo');
   }
 
@@ -376,7 +376,7 @@ class CommandHelperTest extends KernelTestBase {
    * @covers ::setIndexServerCommand
    */
   public function testSetIndexServerCommandWithInvalidIndex() {
-    $this->setExpectedException(ConsoleException::class);
+    $this->expectException(ConsoleException::class);
     $this->systemUnderTest->setIndexServerCommand('foo', 'test_server');
   }
 
@@ -386,7 +386,7 @@ class CommandHelperTest extends KernelTestBase {
    * @covers ::setIndexServerCommand
    */
   public function testSetIndexServerCommandWithInvalidServer() {
-    $this->setExpectedException(ConsoleException::class);
+    $this->expectException(ConsoleException::class);
     $this->systemUnderTest->setIndexServerCommand('test_index', 'bar');
   }
 
diff --git a/tests/src/Unit/Processor/TokenizerTest.php b/tests/src/Unit/Processor/TokenizerTest.php
index b9a102e5..b96d0b3c 100644
--- a/tests/src/Unit/Processor/TokenizerTest.php
+++ b/tests/src/Unit/Processor/TokenizerTest.php
@@ -8,6 +8,7 @@ use Drupal\search_api\Plugin\search_api\processor\Tokenizer;
 use Drupal\search_api\Query\Query;
 use Drupal\search_api\Utility\Utility;
 use Drupal\Tests\UnitTestCase;
+use PHPUnit\Framework\MockObject\MockObject;
 
 /**
  * Tests the "Tokenizer" processor.
@@ -406,7 +407,7 @@ class TokenizerTest extends UnitTestCase {
   public function testPreprocessSearchQuery($keys, $expected) {
     $index = $this->createMock(Index::class);
     assert($index instanceof Index);
-    assert($index instanceof \PHPUnit_Framework_MockObject_MockObject);
+    assert($index instanceof MockObject);
     $index->method('status')->willReturn(TRUE);
     $this->processor->setIndex($index);
 
