diff --git a/dfp.info.yml b/dfp.info.yml
index 5f17e9b..32e4554 100755
--- a/dfp.info.yml
+++ b/dfp.info.yml
@@ -1,7 +1,7 @@
 name: 'Doubleclick for Publishers'
 type: module
 description: 'Integrates DFP Google Publisher Tags onto a site.'
-core_version_requirement: ^8.8 || ^9
+core_version_requirement: ^9.3 || ^10
 package: Advertising
 configure: dfp.admin_settings
 dependencies:
diff --git a/src/View/dfp.adtest.inc b/src/View/dfp.adtest.inc
index 1174524..d6a97ce 100644
--- a/src/View/dfp.adtest.inc
+++ b/src/View/dfp.adtest.inc
@@ -13,10 +13,10 @@ function dfp_adtest_page() {
   $form = drupal_get_form('dfp_adtest_form');
 
   $output[] = [
-    '#markup' => render($form),
+    '#markup' => \Drupal::service('renderer')->render($form),
     '#attached' => [
       'css' => [
-        'dfp-admin' => drupal_get_path('module', 'dfp') . '/dfp.admin.css',
+        'dfp-admin' => \Drupal::service('extension.list.module')->getPath('dfp') . '/dfp.admin.css',
       ],
     ],
   ];
diff --git a/tests/src/Functional/DfpTestBase.php b/tests/src/Functional/DfpTestBase.php
index 7d17b05..b94cfd9 100644
--- a/tests/src/Functional/DfpTestBase.php
+++ b/tests/src/Functional/DfpTestBase.php
@@ -34,7 +34,7 @@ abstract class DfpTestBase extends BrowserTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
 
     // Create an admin user with all the permissions needed to run tests.
@@ -64,7 +64,8 @@ abstract class DfpTestBase extends BrowserTestBase {
   protected function dfpCreateTag($edit = []) {
     // Create a new tag.
     $edit += $this->dfpBasicTagEditValues();
-    $this->drupalPostForm('admin/structure/dfp/tags/add', $edit, t('Save'));
+    $this->drupalGet('admin/structure/dfp/tags/add');
+    $this->submitForm($edit, t('Save'));
 
     // Load the tag object.
     $tag = Tag::load($edit['id']);
@@ -92,7 +93,8 @@ abstract class DfpTestBase extends BrowserTestBase {
     if (isset($edit['id'])) {
       unset($edit['id']);
     }
-    $this->drupalPostForm('admin/structure/dfp/tags/manage/' . $id, $edit, t('Save'));
+    $this->drupalGet('admin/structure/dfp/tags/manage/' . $id);
+    $this->submitForm($edit, t('Save'));
     return Tag::load($id);
   }
 
@@ -184,7 +186,7 @@ abstract class DfpTestBase extends BrowserTestBase {
    */
   protected function assertPropertySet($property, $key, $val) {
     $pattern = $this->getPropertyPattern($property, $key, $val);
-    return $this->assertPattern($pattern, 'A ' . $property . ' property was set for ' . $key . ' = ' . $val);
+    return $this->assertSession()->responseMatches($pattern, 'A ' . $property . ' property was set for ' . $key . ' = ' . $val);
   }
 
   /**
diff --git a/tests/src/Functional/DisplayTagTest.php b/tests/src/Functional/DisplayTagTest.php
index e1baaa0..f0ef24e 100644
--- a/tests/src/Functional/DisplayTagTest.php
+++ b/tests/src/Functional/DisplayTagTest.php
@@ -26,14 +26,14 @@ class DisplayTagTest extends DfpTestBase {
     $tag = $this->dfpCreateTag();
     $tag_view = $this->dfpTagToTagView($tag);
     $this->drupalGet('<front>');
-    $this->assertRaw('googletag.defineSlot("' . $tag_view->getAdUnit() . '", ' . $tag_view->getSize() . ', "' . $tag_view->getPlaceholderId() . '")');
+    $this->assertSession()->responseContains('googletag.defineSlot("' . $tag_view->getAdUnit() . '", ' . $tag_view->getSize() . ', "' . $tag_view->getPlaceholderId() . '")');
 
     // Create a tag with an ID longer than 32 characters.
     $edit = ['id' => mb_strtolower($this->randomMachineName(64))];
     $tag = $this->dfpCreateTag($edit);
     $tag_view = $this->dfpTagToTagView($tag);
     $this->drupalGet('<front>');
-    $this->assertRaw('googletag.defineSlot("' . $tag_view->getAdUnit() . '", ' . $tag_view->getSize() . ', "' . $tag_view->getPlaceholderId() . '")');
+    $this->assertSession()->responseContains('googletag.defineSlot("' . $tag_view->getAdUnit() . '", ' . $tag_view->getSize() . ', "' . $tag_view->getPlaceholderId() . '")');
   }
 
   /**
@@ -58,27 +58,27 @@ class DisplayTagTest extends DfpTestBase {
       $mapping_tag .= ($i + 1 !== $size_count) ? $mapping_sizes[$i] . ', ' : $mapping_sizes[$i];
     }
     $mapping_tag .= ($size_count > 1) ? '])' : ')';
-    $this->assertRaw('googletag.sizeMapping()', 'The ad slot correctly attaches size mapping.');
-    $this->assertRaw('.defineSizeMapping(mapping)', 'The ad slot correctly defines size mapping.');
-    $this->assertRaw($mapping_tag, 'The ad slot correctly defines specific size mappings.');
+    $this->assertSession()->responseContains('googletag.sizeMapping()');
+    $this->assertSession()->responseContains('.defineSizeMapping(mapping)');
+    $this->assertSession()->responseContains($mapping_tag);
 
     // Create a tag with invalid browser size mappings.
     $edit['breakpoints[0][browser_size]'] = '100y100';
     $this->dfpEditTag($tag->id(), $edit);
-    $this->assertText(t('The browser size can only contain numbers and the character x.'), 'An error was correctly thrown when invalid characters.');
+    $this->assertSession()->pageTextContains(t('The browser size can only contain numbers and the character x.'));
 
     // Create a tag with invalid ad size mappings.
     $edit['breakpoints[0][browser_size]'] = $this->dfpGenerateSize();
     $edit['breakpoints[0][ad_sizes]'] = '100y100,200x200';
     $this->dfpEditTag($tag->id(), $edit);
-    $this->assertText(t('The ad size(s) string can only contain numbers, the character x and commas (unless it is the special keyword "&lt;none&gt;").'), 'An error was correctly thrown when invalid characters.');
+    $this->assertSession()->pageTextContains(t('The ad size(s) string can only contain numbers, the character x and commas (unless it is the special keyword "&lt;none&gt;").'));
 
     // Test tags with ad_size set to <none>.
     $edit['breakpoints[0][browser_size]'] = '0x0';
     $edit['breakpoints[0][ad_sizes]'] = '<none>';
     $this->dfpEditTag($tag->id(), $edit);
     $this->drupalGet('');
-    $this->assertRaw('addSize([0, 0], [])');
+    $this->assertSession()->responseContains('addSize([0, 0], [])');
   }
 
   /**
@@ -93,28 +93,29 @@ class DisplayTagTest extends DfpTestBase {
     $edit['slug'] = '';
     $tag = $this->dfpCreateTag($edit);
     $this->drupalGet('<front>');
-    $this->assertText('Global DFP slug', 'The default slug is correctly used when no slug exists for an individual tag.');
+    $this->assertSession()->pageTextContains('Global DFP slug');
 
     // Change the slug to <none> and ensure that no slug is displayed.
     $edit['slug'] = '<none>';
     $this->dfpEditTag($tag->id(), $edit);
     $this->drupalGet('<front>');
-    $this->assertNoText('Global DFP slug', 'No slug is appearing when "<none>" is used.');
+    $this->assertSession()->pageTextNotContains('Global DFP slug');
 
     // Specify a slug and check that it shows instead of the default slug.
     $edit['slug'] = 'Tag specific slug';
     $this->dfpEditTag($tag->id(), $edit);
     $this->drupalGet('<front>');
-    $this->assertText('Tag specific slug');
+    $this->assertSession()->pageTextContains('Tag specific slug');
 
     // Set the slug to be hidden. Use admin UI and the cache tags added in
     // \Drupal\dfp\View\TagViewBuilder::viewMultiple() are tested.
     $edit = [
       'hide_slug' => TRUE,
     ];
-    $this->drupalPostForm('admin/structure/dfp/settings', $edit, t('Save configuration'));
+    $this->drupalGet('admin/structure/dfp/settings');
+    $this->submitForm($edit, t('Save configuration'));
     $this->drupalGet('<front>');
-    $this->assertNoText('Tag specific slug');
+    $this->assertSession()->pageTextNotContains('Tag specific slug');
   }
 
   /**
@@ -144,13 +145,13 @@ class DisplayTagTest extends DfpTestBase {
     $edit['targeting[0][target]'] = $this->randomMachineName();
     $edit['targeting[0][value]'] = '';
     $this->dfpEditTag($tag->id(), $edit);
-    $this->assertText(t('The value cannot be empty if a target exists.'));
+    $this->assertSession()->pageTextContains(t('The value cannot be empty if a target exists.'));
 
     // Create a tag with an empty target, but a value.
     $edit['targeting[0][target]'] = '';
     $edit['targeting[0][value]'] = $this->randomMachineName();
     $this->dfpEditTag($tag->id(), $edit);
-    $this->assertText(t('The target cannot be empty if a value exists.'));
+    $this->assertSession()->pageTextContains(t('The target cannot be empty if a value exists.'));
 
     // Create a tag with multiple targets.
     $count = 3;
diff --git a/tests/src/Functional/GlobalSettingsTest.php b/tests/src/Functional/GlobalSettingsTest.php
index ec2d6f2..e98c230 100644
--- a/tests/src/Functional/GlobalSettingsTest.php
+++ b/tests/src/Functional/GlobalSettingsTest.php
@@ -22,7 +22,7 @@ class GlobalSettingsTest extends DfpTestBase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
     $web_user = $this->drupalCreateUser(['administer DFP']);
     $this->drupalLogin($web_user);
@@ -41,10 +41,11 @@ class GlobalSettingsTest extends DfpTestBase {
       'targeting[0][target]' => '<em>test target</em>',
       'targeting[0][value]' => '<em>test value</em>, test value 2 ',
     ];
-    $this->drupalPostForm('admin/structure/dfp/settings', $edit, t('Save configuration'));
+    $this->drupalGet('admin/structure/dfp/settings');
+    $this->submitForm($edit, t('Save configuration'));
 
     $this->drupalGet('<front>');
-    $this->assertNoRaw('googletag', 'With no DFP tags set up there is no additional JS added');
+    $this->assertSession()->responseNotContains('googletag');
 
     // Create a tag.
     $tag = $this->dfpCreateTag();
@@ -52,11 +53,11 @@ class GlobalSettingsTest extends DfpTestBase {
     $tag->save();
 
     $this->drupalGet('<front>');
-    $this->assertRaw('googletag.pubads().enableAsyncRendering();', 'Asynchronous rendering is turned on.');
-    $this->assertRaw('googletag.pubads().enableSingleRequest();', 'Single request is turned on.');
-    $this->assertRaw('googletag.pubads().collapseEmptyDivs();', 'Collapse empty divs is turned on.');
-    $this->assertRaw("googletag.pubads().setTargeting('&lt;em&gt;test target&lt;/em&gt;', ['&lt;em&gt;test value&lt;/em&gt;','test value 2']);", 'Global targeting values appear correclty in javascript.');
-    $this->assertRaw('/123456789/example.com');
+    $this->assertSession()->responseContains('googletag.pubads().enableAsyncRendering();');
+    $this->assertSession()->responseContains('googletag.pubads().enableSingleRequest();');
+    $this->assertSession()->responseContains('googletag.pubads().collapseEmptyDivs();');
+    $this->assertSession()->responseContains("googletag.pubads().setTargeting('&lt;em&gt;test target&lt;/em&gt;', ['&lt;em&gt;test value&lt;/em&gt;','test value 2']);");
+    $this->assertSession()->responseContains('/123456789/example.com');
 
     $edit = [
       'network_id' => '123456789',
@@ -69,24 +70,26 @@ class GlobalSettingsTest extends DfpTestBase {
       'targeting[1][target]' => 'test target 2',
       'targeting[1][value]' => 'test value 4',
     ];
-    $this->drupalPostForm('admin/structure/dfp/settings', $edit, t('Save configuration'));
+    $this->drupalGet('admin/structure/dfp/settings');
+    $this->submitForm($edit, t('Save configuration'));
 
     $this->drupalGet('<front>');
-    $this->assertNoRaw('googletag.pubads().enableAsyncRendering();', 'Asynchronous rendering is turned on.');
-    $this->assertNoRaw('googletag.pubads().enableSingleRequest();', 'Single request is turned on.');
-    $this->assertNoRaw('googletag.pubads().collapseEmptyDivs();', 'Collapse empty divs is turned on.');
-    $this->assertRaw("googletag.pubads().setTargeting('test target', ['test value 3']);", 'Global targeting values appear correctly in javascript.');
-    $this->assertRaw("googletag.pubads().setTargeting('test target 2', ['test value 4']);", 'Global targeting values appear correctly in javascript.');
-    $this->assertEqual('/custom_click_url', \Drupal::config('dfp.settings')->get('click_url'));
+    $this->assertSession()->responseNotContains('googletag.pubads().enableAsyncRendering();');
+    $this->assertSession()->responseNotContains('googletag.pubads().enableSingleRequest();');
+    $this->assertSession()->responseNotContains('googletag.pubads().collapseEmptyDivs();');
+    $this->assertSession()->responseContains("googletag.pubads().setTargeting('test target', ['test value 3']);");
+    $this->assertSession()->responseContains("googletag.pubads().setTargeting('test target 2', ['test value 4']);");
+    $this->assertEquals('/custom_click_url', \Drupal::config('dfp.settings')->get('click_url'));
 
     $edit = [
       'async_rendering' => TRUE,
       'click_url' => '/custom_click_url',
       'adunit_pattern' => '$has_an_illegal_character',
     ];
-    $this->drupalPostForm('admin/structure/dfp/settings', $edit, t('Save configuration'));
-    $this->assertText(t('Setting a click URL does not work with async rendering.'));
-    $this->assertText(t('Ad Unit Patterns can only include letters, numbers, hyphens, dashes, periods, slashes and tokens.'));
+    $this->drupalGet('admin/structure/dfp/settings');
+    $this->submitForm($edit, t('Save configuration'));
+    $this->assertSession()->pageTextContains(t('Setting a click URL does not work with async rendering.'));
+    $this->assertSession()->pageTextContains(t('Ad Unit Patterns can only include letters, numbers, hyphens, dashes, periods, slashes and tokens.'));
   }
 
 }
diff --git a/tests/src/Unit/DfpHtmlResponseAttachmentsProcessorTest.php b/tests/src/Unit/DfpHtmlResponseAttachmentsProcessorTest.php
index 51d53d8..a2a666c 100644
--- a/tests/src/Unit/DfpHtmlResponseAttachmentsProcessorTest.php
+++ b/tests/src/Unit/DfpHtmlResponseAttachmentsProcessorTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Tests\dfp\Unit;
 
+use Prophecy\PhpUnit\ProphecyTrait;
 use Drupal\Core\Asset\AssetCollectionRendererInterface;
 use Drupal\Core\Asset\AssetResolverInterface;
 use Drupal\Core\Config\ConfigFactoryInterface;
@@ -26,10 +27,11 @@ use Symfony\Component\HttpFoundation\RequestStack;
  */
 class DfpHtmlResponseAttachmentsProcessorTest extends UnitTestCase {
 
+  use ProphecyTrait;
   /**
    * A mock core html attachment processor.
    *
-   * @var \Drupal\Core\Render\AttachmentsResponseProcessorInterface|\PHPUnit_Framework_MockObject_MockObject
+   * @var \Drupal\Core\Render\AttachmentsResponseProcessorInterface|\PHPUnit\Framework\MockObject\MockObject
    */
   protected $attachmentProcessor;
 
@@ -85,10 +87,10 @@ class DfpHtmlResponseAttachmentsProcessorTest extends UnitTestCase {
   /**
    * {@inheritdoc}
    */
-  protected function setUp() {
+  protected function setUp(): void {
     parent::setUp();
     // Mock core attachment processor.
-    $this->attachmentProcessor = $this->getMockBuilder(AttachmentsResponseProcessorInterface::class)->disableOriginalConstructor()->getMock();
+    $this->attachmentProcessor = $this->createMock(AttachmentsResponseProcessorInterface::class);
     $this->attachmentProcessor->method('processAttachments')
       ->willReturnArgument(0);
 
diff --git a/tests/src/Unit/View/TagViewTest.php b/tests/src/Unit/View/TagViewTest.php
index c0bfb58..31e316a 100644
--- a/tests/src/Unit/View/TagViewTest.php
+++ b/tests/src/Unit/View/TagViewTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\Tests\dfp\Unit\View;
 
+use Prophecy\PhpUnit\ProphecyTrait;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\dfp\TokenInterface;
 use Drupal\dfp\Entity\TagInterface;
@@ -19,6 +20,7 @@ use Drupal\Tests\UnitTestCase;
  */
 class TagViewTest extends UnitTestCase {
 
+  use ProphecyTrait;
   /**
    * @covers ::formatSize
    * @dataProvider formatSizeProvider
@@ -110,7 +112,7 @@ class TagViewTest extends UnitTestCase {
     $token->method('replace')->willReturnArgument(0);
     $module_handler = $this->prophesize(ModuleHandlerInterface::class)->reveal();
     $tag_view = new TagView($tag->reveal(), $config_factory->get('dfp.settings'), $token, $module_handler);
-    $this->assertRegExp($regex, $tag_view->getShortTagQueryString());
+    $this->assertMatchesRegularExpression($regex, $tag_view->getShortTagQueryString());
   }
 
   /**
