diff --git a/panelizer.api.php b/panelizer.api.php
index 6d60a6e..1b5b0bb 100644
--- a/panelizer.api.php
+++ b/panelizer.api.php
@@ -1,4 +1,5 @@
 <?php
+use Drupal\Core\Entity\EntityInterface;
 /**
  * @file
  * Developer documentation.
@@ -19,7 +20,7 @@
  * @param string $langcode
  *   The langcode.
  */
-function hook_panelizer_pre_view_builder_alter(&$view_mode, \Drupal\Core\Entity\EntityInterface $entity, &$langcode) {
+function hook_panelizer_pre_view_builder_alter(&$view_mode, EntityInterface $entity, &$langcode) {
   if ($entity->bundle() == 'page') {
     $view_mode = 'my_custom_view_mode';
   }
@@ -27,4 +28,4 @@ function hook_panelizer_pre_view_builder_alter(&$view_mode, \Drupal\Core\Entity\
 
 /**
  * @} End of "addtogroup hooks".
- */
\ No newline at end of file
+ */
diff --git a/panelizer_quickedit/tests/src/FunctionalJavascript/PanelizerQuickEditTest.php b/panelizer_quickedit/tests/src/FunctionalJavascript/PanelizerQuickEditTest.php
index 3619b4b..53d0190 100644
--- a/panelizer_quickedit/tests/src/FunctionalJavascript/PanelizerQuickEditTest.php
+++ b/panelizer_quickedit/tests/src/FunctionalJavascript/PanelizerQuickEditTest.php
@@ -26,7 +26,7 @@ class PanelizerQuickEditTest extends WebDriverTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     $this->drupalCreateContentType(['type' => 'page', 'name' => 'Page']);
diff --git a/tests/src/Functional/PanelizerAddDefaultLinkTest.php b/tests/src/Functional/PanelizerAddDefaultLinkTest.php
index fc83ce5..6e65921 100644
--- a/tests/src/Functional/PanelizerAddDefaultLinkTest.php
+++ b/tests/src/Functional/PanelizerAddDefaultLinkTest.php
@@ -60,13 +60,13 @@ class PanelizerAddDefaultLinkTest extends BrowserTestBase {
     $this->panelize($content_type);
 
     // Confirm that the content type is now panelized.
-    $this->assertLink('Add a new Panelizer default display');
+    $this->assertSession()->linkExists('Add a new Panelizer default display');
 
     // Un-panelize the content type.
     $this->unpanelize($content_type);
 
     // Confirm that the content type is no longer panelized.
-    $this->assertNoLink('Add a new Panelizer default display');
+    $this->assertSession()->linkNotExists('Add a new Panelizer default display');
   }
 
 }
diff --git a/tests/src/Functional/PanelizerDefaultsTest.php b/tests/src/Functional/PanelizerDefaultsTest.php
index 79e7fc0..a38657d 100644
--- a/tests/src/Functional/PanelizerDefaultsTest.php
+++ b/tests/src/Functional/PanelizerDefaultsTest.php
@@ -44,7 +44,7 @@ class PanelizerDefaultsTest extends BrowserTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     // Place the local actions block in the theme so that we can assert the
@@ -70,18 +70,18 @@ class PanelizerDefaultsTest extends BrowserTestBase {
       // to (the panelizer[allow] checkbox in the view display configuration). By
       // default, they aren't.
       $this->drupalGet('node/add/page');
-      $this->assertResponse(200);
-      $this->assertNoFieldByName("panelizer['{$i}][default]");
+      $this->assertSession()->statusCodeEquals(200);
+      $this->assertSession()->fieldValueNotEquals("panelizer['{$i}][default]", '');
       // Allow user to select panelized modes in UI.
       $this->panelize('page', $view_mode_name, [
         'panelizer[custom]' => TRUE,
         'panelizer[allow]' => TRUE,
       ]);
       $this->drupalGet('node/add/page');
-      $this->assertResponse(200);
-      $this->assertFieldByName("panelizer[{$i}][default]");
-      $this->assertOption("edit-panelizer-{$i}-default", 'default');
-      $this->assertOption("edit-panelizer-{$i}-default", $panelizer_id);
+      $this->assertSession()->statusCodeEquals(200);
+      $this->assertSession()->fieldExists("panelizer[{$i}][default]");
+      $this->assertSession()->optionExists("edit-panelizer-{$i}-default", 'default');
+      $this->assertSession()->optionExists("edit-panelizer-{$i}-default", $panelizer_id);
       // Clean up.
       $this->deletePanelizerDefault('page', $view_mode_name, $panelizer_id);
       $this->assertDefaultNotExists('page', $view_mode_name, $panelizer_id);
diff --git a/tests/src/Functional/PanelizerIpeTest.php b/tests/src/Functional/PanelizerIpeTest.php
index 1a82981..fe18f56 100644
--- a/tests/src/Functional/PanelizerIpeTest.php
+++ b/tests/src/Functional/PanelizerIpeTest.php
@@ -44,7 +44,7 @@ class PanelizerIpeTest extends BrowserTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     // Reload all caches.
@@ -104,12 +104,12 @@ class PanelizerIpeTest extends BrowserTestBase {
 
     // Load the test node.
     $this->drupalGet('node/' . $node->id());
-    $this->assertResponse(200);
+    $this->assertSession()->statusCodeEquals(200);
 
     // Confirm the JSON Drupal settings are appropriate.
     $drupalSettings = NULL;
     $matches = [];
-    if (preg_match('@<script type="application/json" data-drupal-selector="drupal-settings-json">([^<]*)</script>@', $this->getRawContent(), $matches)) {
+    if (preg_match('@<script type="application/json" data-drupal-selector="drupal-settings-json">([^<]*)</script>@', $this->getSession()->getPage()->getContent(), $matches)) {
       $drupalSettings = Json::decode($matches[1]);
       $this->verbose('<pre>' . print_r($drupalSettings, TRUE) . '</pre>');
     }
@@ -124,9 +124,9 @@ class PanelizerIpeTest extends BrowserTestBase {
       $this->assertTrue(isset($drupalSettings['panelizer']));
       $this->assertTrue(isset($drupalSettings['panelizer']['entity']));
       $this->assertTrue(isset($drupalSettings['panelizer']['entity']['entity_type_id']));
-      $this->assertEqual($drupalSettings['panelizer']['entity']['entity_type_id'], 'node');
+      $this->assertEquals($drupalSettings['panelizer']['entity']['entity_type_id'], 'node');
       $this->assertTrue(isset($drupalSettings['panelizer']['entity']['entity_id']));
-      $this->assertEqual($drupalSettings['panelizer']['entity']['entity_id'], $node->id());
+      $this->assertEquals($drupalSettings['panelizer']['entity']['entity_id'], $node->id());
       $this->assertTrue(isset($drupalSettings['panelizer']['user_permission']));
       $this->assertTrue(isset($drupalSettings['panelizer']['user_permission']['revert']));
       $this->assertTrue(isset($drupalSettings['panelizer']['user_permission']['save_default']));
@@ -151,12 +151,12 @@ class PanelizerIpeTest extends BrowserTestBase {
 
     // Load the test node.
     $this->drupalGet('node/' . $node->id());
-    $this->assertResponse(200);
+    $this->assertSession()->statusCodeEquals(200);
 
     // Confirm the appropriate DOM structures are present for the IPE.
     $drupalSettings = NULL;
     $matches = [];
-    if (preg_match('@<script type="application/json" data-drupal-selector="drupal-settings-json">([^<]*)</script>@', $this->getRawContent(), $matches)) {
+    if (preg_match('@<script type="application/json" data-drupal-selector="drupal-settings-json">([^<]*)</script>@', $this->getSession()->getPage()->getContent(), $matches)) {
       $drupalSettings = Json::decode($matches[1]);
       $this->verbose('<pre>' . print_r($drupalSettings, TRUE) . '</pre>');
     }
@@ -171,9 +171,9 @@ class PanelizerIpeTest extends BrowserTestBase {
       $this->assertTrue(isset($drupalSettings['panelizer']));
       $this->assertTrue(isset($drupalSettings['panelizer']['entity']));
       $this->assertTrue(isset($drupalSettings['panelizer']['entity']['entity_type_id']));
-      $this->assertEqual($drupalSettings['panelizer']['entity']['entity_type_id'], 'node');
+      $this->assertEquals($drupalSettings['panelizer']['entity']['entity_type_id'], 'node');
       $this->assertTrue(isset($drupalSettings['panelizer']['entity']['entity_id']));
-      $this->assertEqual($drupalSettings['panelizer']['entity']['entity_id'], $node->id());
+      $this->assertEquals($drupalSettings['panelizer']['entity']['entity_id'], $node->id());
       $this->assertTrue(isset($drupalSettings['panelizer']['user_permission']));
       $this->assertTrue(isset($drupalSettings['panelizer']['user_permission']['revert']));
       $this->assertTrue(isset($drupalSettings['panelizer']['user_permission']['save_default']));
@@ -223,9 +223,9 @@ class PanelizerIpeTest extends BrowserTestBase {
       $this->assertTrue(isset($drupalSettings['panelizer']));
       $this->assertTrue(isset($drupalSettings['panelizer']['entity']));
       $this->assertTrue(isset($drupalSettings['panelizer']['entity']['entity_type_id']));
-      $this->assertEqual($drupalSettings['panelizer']['entity']['entity_type_id'], 'node');
+      $this->assertEquals($drupalSettings['panelizer']['entity']['entity_type_id'], 'node');
       $this->assertTrue(isset($drupalSettings['panelizer']['entity']['entity_id']));
-      $this->assertEqual($drupalSettings['panelizer']['entity']['entity_id'], $node->id());
+      $this->assertEquals($drupalSettings['panelizer']['entity']['entity_id'], $node->id());
       $this->assertTrue(isset($drupalSettings['panelizer']['user_permission']));
       $this->assertTrue(isset($drupalSettings['panelizer']['user_permission']['revert']));
       $this->assertTrue(isset($drupalSettings['panelizer']['user_permission']['save_default']));
@@ -278,9 +278,9 @@ class PanelizerIpeTest extends BrowserTestBase {
       $this->assertTrue(isset($drupalSettings['panelizer']));
       $this->assertTrue(isset($drupalSettings['panelizer']['entity']));
       $this->assertTrue(isset($drupalSettings['panelizer']['entity']['entity_type_id']));
-      $this->assertEqual($drupalSettings['panelizer']['entity']['entity_type_id'], 'node');
+      $this->assertEquals($drupalSettings['panelizer']['entity']['entity_type_id'], 'node');
       $this->assertTrue(isset($drupalSettings['panelizer']['entity']['entity_id']));
-      $this->assertEqual($drupalSettings['panelizer']['entity']['entity_id'], $node->id());
+      $this->assertEquals($drupalSettings['panelizer']['entity']['entity_id'], $node->id());
       $this->assertTrue(isset($drupalSettings['panelizer']['user_permission']));
       $this->assertTrue(isset($drupalSettings['panelizer']['user_permission']['revert']));
       $this->assertTrue(isset($drupalSettings['panelizer']['user_permission']['save_default']));
@@ -334,9 +334,9 @@ class PanelizerIpeTest extends BrowserTestBase {
       $this->assertTrue(isset($drupalSettings['panelizer']));
       $this->assertTrue(isset($drupalSettings['panelizer']['entity']));
       $this->assertTrue(isset($drupalSettings['panelizer']['entity']['entity_type_id']));
-      $this->assertEqual($drupalSettings['panelizer']['entity']['entity_type_id'], 'node');
+      $this->assertEquals($drupalSettings['panelizer']['entity']['entity_type_id'], 'node');
       $this->assertTrue(isset($drupalSettings['panelizer']['entity']['entity_id']));
-      $this->assertEqual($drupalSettings['panelizer']['entity']['entity_id'], $node->id());
+      $this->assertEquals($drupalSettings['panelizer']['entity']['entity_id'], $node->id());
       $this->assertTrue(isset($drupalSettings['panelizer']['user_permission']));
       $this->assertTrue(isset($drupalSettings['panelizer']['user_permission']['revert']));
       $this->assertTrue(isset($drupalSettings['panelizer']['user_permission']['save_default']));
@@ -368,12 +368,12 @@ class PanelizerIpeTest extends BrowserTestBase {
 
     // Load the test node.
     $this->drupalGet('node/' . $node->id());
-    $this->assertResponse(200);
+    $this->assertSession()->statusCodeEquals(200);
 
     // Extract the drupalSettings structure and return it.
     $drupalSettings = NULL;
     $matches = [];
-    if (preg_match('@<script type="application/json" data-drupal-selector="drupal-settings-json">([^<]*)</script>@', $this->getRawContent(), $matches)) {
+    if (preg_match('@<script type="application/json" data-drupal-selector="drupal-settings-json">([^<]*)</script>@', $this->getSession()->getPage()->getContent(), $matches)) {
       $drupalSettings = Json::decode($matches[1]);
       $this->verbose('<pre>' . print_r($drupalSettings, TRUE) . '</pre>');
     }
diff --git a/tests/src/Functional/PanelizerNodeFunctionalTest.php b/tests/src/Functional/PanelizerNodeFunctionalTest.php
index 15fef8f..0f7b676 100644
--- a/tests/src/Functional/PanelizerNodeFunctionalTest.php
+++ b/tests/src/Functional/PanelizerNodeFunctionalTest.php
@@ -44,7 +44,7 @@ class PanelizerNodeFunctionalTest extends BrowserTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     $this->setupContentType();
@@ -58,13 +58,13 @@ class PanelizerNodeFunctionalTest extends BrowserTestBase {
   public function testWizardUI() {
     // Enter the wizard.
     $this->drupalGet('admin/structure/panelizer/edit/node__page__default__default');
-    $this->assertResponse(200);
-    $this->assertText('Wizard Information');
-    $this->assertField('edit-label');
+    $this->assertSession()->statusCodeEquals(200);
+    $this->assertSession()->pageTextContains('Wizard Information');
+    $this->assertSession()->fieldExists('edit-label');
 
     // Contexts step.
     $this->clickLink('Contexts');
-    $this->assertText('@panelizer.entity_context:entity', 'The current entity context is present.');
+    $this->assertSession()->pageTextContains('@panelizer.entity_context:entity');
 
     // Layout selection step.
     $this->clickLink('Layout');
@@ -77,58 +77,58 @@ class PanelizerNodeFunctionalTest extends BrowserTestBase {
     $edit = [
       'region' => 'content',
     ];
-    $this->drupalPostForm(NULL, $edit, t('Add block'));
-    $this->assertResponse(200);
+    $this->submitForm($edit, t('Add block'));
+    $this->assertSession()->statusCodeEquals(200);
 
     // Finish the wizard.
-    $this->drupalPostForm(NULL, [], t('Update and save'));
-    $this->assertResponse(200);
+    $this->submitForm([], t('Update and save'));
+    $this->assertSession()->statusCodeEquals(200);
     // Confirm this returned to the main wizard page.
-    $this->assertText('Wizard Information');
-    $this->assertField('edit-label');
+    $this->assertSession()->pageTextContains('Wizard Information');
+    $this->assertSession()->fieldExists('edit-label');
 
     // Return to the Manage Display page, which is where the Cancel button
     // currently sends you. That's a UX WTF and should be fixed...
-    $this->drupalPostForm(NULL, [], t('Cancel'));
-    $this->assertResponse(200);
+    $this->submitForm([], t('Cancel'));
+    $this->assertSession()->statusCodeEquals(200);
 
     // Confirm the page is back to the content type settings page.
-    $this->assertFieldChecked('edit-panelizer-custom');
+    $this->assertSession()->checkboxChecked('edit-panelizer-custom');
 
     // Now change and save the general setting.
     $edit = [
       'panelizer[custom]' => FALSE,
     ];
-    $this->drupalPostForm(NULL, $edit, t('Save'));
-    $this->assertResponse(200);
-    $this->assertNoFieldChecked('edit-panelizer-custom');
+    $this->submitForm($edit, t('Save'));
+    $this->assertSession()->statusCodeEquals(200);
+    $this->assertSession()->checkboxNotChecked('edit-panelizer-custom');
 
     // Add another block at the Content step and then save changes.
     $this->drupalGet('admin/structure/panelizer/edit/node__page__default__default/content');
-    $this->assertResponse(200);
+    $this->assertSession()->statusCodeEquals(200);
     $this->clickLink('Add new block');
     $this->clickLink('Body');
     $edit = [
       'region' => 'content',
     ];
-    $this->drupalPostForm(NULL, $edit, t('Add block'));
-    $this->assertResponse(200);
-    $this->assertText('entity_field:node:body', 'The body block was added successfully.');
-    $this->drupalPostForm(NULL, [], t('Save'));
-    $this->assertResponse(200);
+    $this->submitForm($edit, t('Add block'));
+    $this->assertSession()->statusCodeEquals(200);
+    $this->assertSession()->pageTextContains('entity_field:node:body');
+    $this->submitForm([], t('Save'));
+    $this->assertSession()->statusCodeEquals(200);
     $this->clickLink('Content');
-    $this->assertText('entity_field:node:body', 'The body block was saved successfully.');
+    $this->assertSession()->pageTextContains('entity_field:node:body');
 
     // Check that the Manage Display tab changed now that Panelizer is set up.
     // Also, the field display table should be hidden.
-    $this->assertNoRaw('<div id="field-display-overview-wrapper">');
+    $this->assertSession()->responseNotContains('<div id="field-display-overview-wrapper">');
 
     // Disable Panelizer for the default display mode. This should bring back
     // the field overview table at Manage Display and not display the link to
     // edit the default Panelizer layout.
     $this->unpanelize('page');
-    $this->assertNoLinkByHref('admin/structure/panelizer/edit/node__page__default');
-    $this->assertRaw('<div id="field-display-overview-wrapper">');
+    $this->assertSession()->linkByHrefNotExists('admin/structure/panelizer/edit/node__page__default');
+    $this->assertSession()->responseContains('<div id="field-display-overview-wrapper">');
   }
 
   /**
@@ -150,19 +150,19 @@ class PanelizerNodeFunctionalTest extends BrowserTestBase {
     // Create a node, and check that the IPE is visible on it.
     $node = $this->drupalCreateNode(['type' => 'page']);
     $out = $this->drupalGet('node/' . $node->id());
-    $this->assertResponse(200);
+    $this->assertSession()->statusCodeEquals(200);
     $this->verbose($out);
     $elements = $this->xpath('//*[@id="panels-ipe-content"]');
     if (is_array($elements)) {
-      $this->assertIdentical(count($elements), 1);
+      $this->assertSame(count($elements), 1);
     }
     else {
       $this->fail('Could not parse page content.');
     }
 
     // Check that the block we added is visible.
-    $this->assertText('Panelizer test');
-    $this->assertText('Abracadabra');
+    $this->assertSession()->pageTextContains('Panelizer test');
+    $this->assertSession()->pageTextContains('Abracadabra');
   }
 
 }
diff --git a/tests/src/Functional/PanelizerNodeTranslationsTest.php b/tests/src/Functional/PanelizerNodeTranslationsTest.php
index 714f92e..d460919 100644
--- a/tests/src/Functional/PanelizerNodeTranslationsTest.php
+++ b/tests/src/Functional/PanelizerNodeTranslationsTest.php
@@ -44,7 +44,7 @@ class PanelizerNodeTranslationsTest extends ContentTranslationTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     $this->loginUser1();
@@ -72,13 +72,13 @@ class PanelizerNodeTranslationsTest extends ContentTranslationTestBase {
 
     // Enter the wizard.
     $this->drupalGet("admin/structure/panelizer/edit/{$this->entityTypeId}__{$this->bundle}__default__default");
-    $this->assertResponse(200);
-    $this->assertText('Wizard Information');
-    $this->assertField('edit-label');
+    $this->assertSession()->statusCodeEquals(200);
+    $this->assertSession()->pageTextContains('Wizard Information');
+    $this->assertSession()->fieldExists('edit-label');
 
     // Contexts step.
     $this->clickLink('Contexts');
-    $this->assertText('@panelizer.entity_context:entity', 'The current entity context is present.');
+    $this->assertSession()->pageTextContains('@panelizer.entity_context:entity');
 
     // Layout selection step.
     $this->clickLink('Layout');
@@ -92,58 +92,58 @@ class PanelizerNodeTranslationsTest extends ContentTranslationTestBase {
     $edit = [
       'region' => 'content',
     ];
-    $this->drupalPostForm(NULL, $edit, t('Add block'));
-    $this->assertResponse(200);
+    $this->submitForm($edit, t('Add block'));
+    $this->assertSession()->statusCodeEquals(200);
 
     // Finish the wizard.
-    $this->drupalPostForm(NULL, [], t('Update and save'));
-    $this->assertResponse(200);
+    $this->submitForm([], t('Update and save'));
+    $this->assertSession()->statusCodeEquals(200);
     // Confirm this returned to the main wizard page.
-    $this->assertText('Wizard Information');
-    $this->assertField('edit-label');
+    $this->assertSession()->pageTextContains('Wizard Information');
+    $this->assertSession()->fieldExists('edit-label');
 
     // Return to the Manage Display page, which is where the Cancel button
     // currently sends you. That's a UX WTF and should be fixed...
-    $this->drupalPostForm(NULL, [], t('Cancel'));
-    $this->assertResponse(200);
+    $this->submitForm([], t('Cancel'));
+    $this->assertSession()->statusCodeEquals(200);
 
     // Confirm the page is back to the content type settings page.
-    $this->assertFieldChecked('edit-panelizer-custom');
+    $this->assertSession()->checkboxChecked('edit-panelizer-custom');
 
     // Now change and save the general setting.
     $edit = [
       'panelizer[custom]' => FALSE,
     ];
-    $this->drupalPostForm(NULL, $edit, t('Save'));
-    $this->assertResponse(200);
-    $this->assertNoFieldChecked('edit-panelizer-custom');
+    $this->submitForm($edit, t('Save'));
+    $this->assertSession()->statusCodeEquals(200);
+    $this->assertSession()->checkboxNotChecked('edit-panelizer-custom');
 
     // Add another block at the Content step and then save changes.
     $this->drupalGet("admin/structure/panelizer/edit/{$this->entityTypeId}__{$this->bundle}__default__default/content");
-    $this->assertResponse(200);
+    $this->assertSession()->statusCodeEquals(200);
     $this->clickLink('Add new block');
     $this->clickLink('Body');
     $edit = [
       'region' => 'content',
     ];
-    $this->drupalPostForm(NULL, $edit, t('Add block'));
-    $this->assertResponse(200);
-    $this->assertText("entity_field:{$this->entityTypeId}:body", 'The body block was added successfully.');
-    $this->drupalPostForm(NULL, [], t('Save'));
-    $this->assertResponse(200);
+    $this->submitForm($edit, t('Add block'));
+    $this->assertSession()->statusCodeEquals(200);
+    $this->assertSession()->pageTextContains("entity_field:{$this->entityTypeId}:body");
+    $this->submitForm([], t('Save'));
+    $this->assertSession()->statusCodeEquals(200);
     $this->clickLink('Content', 1);
-    $this->assertText("entity_field:{$this->entityTypeId}:body", 'The body block was saved successfully.');
+    $this->assertSession()->pageTextContains("entity_field:{$this->entityTypeId}:body");
 
     // Check that the Manage Display tab changed now that Panelizer is set up.
     // Also, the field display table should be hidden.
-    $this->assertNoRaw('<div id="field-display-overview-wrapper">');
+    $this->assertSession()->responseNotContains('<div id="field-display-overview-wrapper">');
 
     // Disable Panelizer for the default display mode. This should bring back
     // the field overview table at Manage Display and not display the link to
     // edit the default Panelizer layout.
     $this->unpanelize($this->bundle);
-    $this->assertNoLinkByHref("admin/structure/panelizer/edit/{$this->entityTypeId}__{$this->bundle}__default");
-    $this->assertRaw('<div id="field-display-overview-wrapper">');
+    $this->assertSession()->linkByHrefNotExists("admin/structure/panelizer/edit/{$this->entityTypeId}__{$this->bundle}__default");
+    $this->assertSession()->responseContains('<div id="field-display-overview-wrapper">');
   }
 
   /**
@@ -173,25 +173,25 @@ class PanelizerNodeTranslationsTest extends ContentTranslationTestBase {
       ],
     ]);
     $out = $this->drupalGet('node/' . $node->id());
-    $this->assertResponse(200);
+    $this->assertSession()->statusCodeEquals(200);
     $this->verbose($out);
     $elements = $this->xpath('//*[@id="panels-ipe-content"]');
     if (is_array($elements)) {
-      $this->assertIdentical(count($elements), 1);
+      $this->assertSame(count($elements), 1);
     }
     else {
       $this->fail('Could not parse page content.');
     }
 
     // Check that the block we added is visible.
-    $this->assertText('Panelizer test');
-    $this->assertText('Abracadabra');
+    $this->assertSession()->pageTextContains('Panelizer test');
+    $this->assertSession()->pageTextContains('Abracadabra');
 
     // Load the translation page.
     $this->clickLink('Translate');
-    $this->assertText('English (Original language)');
-    $this->assertText('Published');
-    $this->assertText('Not translated');
+    $this->assertSession()->pageTextContains('English (Original language)');
+    $this->assertSession()->pageTextContains('Published');
+    $this->assertSession()->pageTextContains('Not translated');
   }
 
   // @todo Confirm that the different languages of a translated node are loaded properly when using a default display.
diff --git a/tests/src/Functional/PanelizerTermFunctionalTest.php b/tests/src/Functional/PanelizerTermFunctionalTest.php
index c8ccd11..c94f19b 100644
--- a/tests/src/Functional/PanelizerTermFunctionalTest.php
+++ b/tests/src/Functional/PanelizerTermFunctionalTest.php
@@ -44,7 +44,7 @@ class PanelizerTermFunctionalTest extends BrowserTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     Vocabulary::create([
@@ -67,8 +67,8 @@ class PanelizerTermFunctionalTest extends BrowserTestBase {
       'panelizer[enable]' => TRUE,
       'panelizer[custom]' => TRUE,
     ];
-    $this->drupalPostForm(NULL, $edit, t('Save'));
-    $this->assertResponse(200);
+    $this->submitForm($edit, t('Save'));
+    $this->assertSession()->statusCodeEquals(200);
     $this->rebuildAll();
   }
 
@@ -92,19 +92,19 @@ class PanelizerTermFunctionalTest extends BrowserTestBase {
     $term = $this->createTerm();
 
     $out = $this->drupalGet('taxonomy/term/' . $term->id());
-    $this->assertResponse(200);
+    $this->assertSession()->statusCodeEquals(200);
     $this->verbose($out);
     $elements = $this->xpath('//*[@id="panels-ipe-content"]');
     if (is_array($elements)) {
-      $this->assertIdentical(count($elements), 1);
+      $this->assertSame(count($elements), 1);
     }
     else {
       $this->fail('Could not parse page content.');
     }
 
     // Check that the block we added is visible.
-    $this->assertText('Panelizer test');
-    $this->assertText('Abracadabra');
+    $this->assertSession()->pageTextContains('Panelizer test');
+    $this->assertSession()->pageTextContains('Abracadabra');
   }
 
   /**
diff --git a/tests/src/Functional/PanelizerUserFunctionalTest.php b/tests/src/Functional/PanelizerUserFunctionalTest.php
index a0aaec4..a830c66 100644
--- a/tests/src/Functional/PanelizerUserFunctionalTest.php
+++ b/tests/src/Functional/PanelizerUserFunctionalTest.php
@@ -41,7 +41,7 @@ class PanelizerUserFunctionalTest extends BrowserTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     // Create the admin user.
@@ -63,13 +63,13 @@ class PanelizerUserFunctionalTest extends BrowserTestBase {
 
     // Enable Panelizer for this entity.
     $this->drupalGet('admin/config/people/accounts/display');
-    $this->assertResponse(200);
+    $this->assertSession()->statusCodeEquals(200);
     $edit = [
       'panelizer[enable]' => TRUE,
       'panelizer[custom]' => TRUE,
     ];
-    $this->drupalPostForm(NULL, $edit, t('Save'));
-    $this->assertResponse(200);
+    $this->submitForm($edit, t('Save'));
+    $this->assertSession()->statusCodeEquals(200);
 
     // Reload all caches.
     $this->rebuildAll();
@@ -96,21 +96,21 @@ class PanelizerUserFunctionalTest extends BrowserTestBase {
 
     // Check the user entity page.
     $out = $this->drupalGet('user/' . $account->id());
-    $this->assertResponse(200);
+    $this->assertSession()->statusCodeEquals(200);
     $this->verbose($out);
 
     // Verify that
     $elements = $this->xpath('//*[@id="panels-ipe-content"]');
     if (is_array($elements)) {
-      $this->assertIdentical(count($elements), 1);
+      $this->assertSame(count($elements), 1);
     }
     else {
       $this->fail('Could not parse page content.');
     }
 
     // Check that the block we added is visible.
-    $this->assertText('Panelizer test');
-    $this->assertText('Abracadabra');
+    $this->assertSession()->pageTextContains('Panelizer test');
+    $this->assertSession()->pageTextContains('Abracadabra');
   }
 
 }
diff --git a/tests/src/Functional/Update/PanelizerLayoutIDUpdateTest.php b/tests/src/Functional/Update/PanelizerLayoutIDUpdateTest.php
index 4c7ca09..d7fd728 100644
--- a/tests/src/Functional/Update/PanelizerLayoutIDUpdateTest.php
+++ b/tests/src/Functional/Update/PanelizerLayoutIDUpdateTest.php
@@ -30,13 +30,13 @@ class PanelizerLayoutIDUpdateTest extends UpdatePathTestBase {
     $this->drupalLogin($this->rootUser);
     $this->drupalGet('admin/structure/types/manage/article/display');
     $this->clickLink('Edit', 1);
-    $this->assertResponse(200);
+    $this->assertSession()->statusCodeEquals(200);
 
     $this->drupalGet('node/1');
-    $this->assertResponse(200);
+    $this->assertSession()->statusCodeEquals(200);
 
     $this->drupalGet('node/2');
-    $this->assertResponse(200);
+    $this->assertSession()->statusCodeEquals(200);
   }
 
 }
diff --git a/tests/src/FunctionalJavascript/PanelizerIntegrationTest.php b/tests/src/FunctionalJavascript/PanelizerIntegrationTest.php
index 49f27d4..2a2b389 100644
--- a/tests/src/FunctionalJavascript/PanelizerIntegrationTest.php
+++ b/tests/src/FunctionalJavascript/PanelizerIntegrationTest.php
@@ -44,7 +44,7 @@ class PanelizerIntegrationTest extends WebDriverTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     // Create a user with appropriate permissions to use Panels IPE.
diff --git a/tests/src/Unit/PanelizerDefaultPanelsStorageTest.php b/tests/src/Unit/PanelizerDefaultPanelsStorageTest.php
index f0424de..468ff46 100644
--- a/tests/src/Unit/PanelizerDefaultPanelsStorageTest.php
+++ b/tests/src/Unit/PanelizerDefaultPanelsStorageTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\panelizer\Unit;
 
+use Prophecy\PhpUnit\ProphecyTrait;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityStorageInterface;
@@ -23,6 +24,7 @@ use Drupal\Tests\UnitTestCase;
  */
 class PanelizerDefaultPanelsStorageTest extends UnitTestCase {
 
+  use ProphecyTrait;
   /**
    * @var \Drupal\Core\Entity\EntityStorageInterface|\Prophecy\Prophecy\ProphecyInterface
    */
@@ -46,7 +48,7 @@ class PanelizerDefaultPanelsStorageTest extends UnitTestCase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     $this->storage = $this->prophesize(EntityStorageInterface::class);
diff --git a/tests/src/Unit/PanelizerEntityViewBuilderTest.php b/tests/src/Unit/PanelizerEntityViewBuilderTest.php
index b934da9..e0f8392 100644
--- a/tests/src/Unit/PanelizerEntityViewBuilderTest.php
+++ b/tests/src/Unit/PanelizerEntityViewBuilderTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\panelizer\Unit;
 
+use Prophecy\PhpUnit\ProphecyTrait;
 use Drupal\Core\Entity\Display\EntityViewDisplayInterface;
 use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityTypeInterface;
@@ -29,6 +30,7 @@ use Drupal\Tests\UnitTestCase;
  */
 class PanelizerEntityViewBuilderTest extends UnitTestCase {
 
+  use ProphecyTrait;
   /**
    * Information about the entity type.
    *
@@ -74,7 +76,7 @@ class PanelizerEntityViewBuilderTest extends UnitTestCase {
   /**
    * The Panelizer entity view builder.
    *
-   * @var \Drupal\panelizer\PanelizerEntityViewBuilder|\PHPUnit_Framework_MockObject_MockObject
+   * @var \Drupal\panelizer\PanelizerEntityViewBuilder|\PHPUnit\Framework\MockObject\MockObject
    */
   protected $entityViewBuilder;
 
@@ -95,7 +97,7 @@ class PanelizerEntityViewBuilderTest extends UnitTestCase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     $this->entityType = $this->prophesize(EntityTypeInterface::class);
diff --git a/tests/src/Unit/PanelizerFieldPanelsStorageTest.php b/tests/src/Unit/PanelizerFieldPanelsStorageTest.php
index b9e238a..440926a 100644
--- a/tests/src/Unit/PanelizerFieldPanelsStorageTest.php
+++ b/tests/src/Unit/PanelizerFieldPanelsStorageTest.php
@@ -2,6 +2,7 @@
 
 namespace Drupal\Tests\panelizer\Unit;
 
+use Prophecy\PhpUnit\ProphecyTrait;
 use Drupal\Core\Access\AccessResult;
 use Drupal\Core\Entity\EntityStorageInterface;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
@@ -23,6 +24,7 @@ use Drupal\Tests\UnitTestCase;
  */
 class PanelizerFieldPanelsStorageTest extends UnitTestCase {
 
+  use ProphecyTrait;
   /**
    * @var \Drupal\Core\Entity\EntityStorageInterface|\Prophecy\Prophecy\ProphecyInterface
    */
@@ -46,7 +48,7 @@ class PanelizerFieldPanelsStorageTest extends UnitTestCase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     $this->storage = $this->prophesize(EntityStorageInterface::class);
