diff --git a/src/FlippyEvent.php b/src/FlippyEvent.php
index 1fd8b4a..d151b5d 100644
--- a/src/FlippyEvent.php
+++ b/src/FlippyEvent.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\flippy;
 
-use Symfony\Component\EventDispatcher\Event;
+use Symfony\Contracts\EventDispatcher\Event;
 use Drupal\node\NodeInterface;
 
 /**
diff --git a/src/FlippyPager.php b/src/FlippyPager.php
index 609bf2a..f6ba2a9 100644
--- a/src/FlippyPager.php
+++ b/src/FlippyPager.php
@@ -304,7 +304,7 @@ class FlippyPager {
         'last' => $last,
       ];
       $event = new FlippyEvent($queries, $node);
-      $this->eventDispatcher->dispatch('buildFlippyQuery', $event);
+      $this->eventDispatcher->dispatch($event, 'buildFlippyQuery');
       $queries = $event->getQueries();
 
       // Execute the queries.
diff --git a/tests/src/Functional/FlippyTest.php b/tests/src/Functional/FlippyTest.php
index 1ce698b..085f214 100644
--- a/tests/src/Functional/FlippyTest.php
+++ b/tests/src/Functional/FlippyTest.php
@@ -14,7 +14,7 @@ class FlippyTest extends BrowserTestBase {
    *
    * @var array
    */
-  public static $modules = ['node', 'flippy',];
+  protected static $modules = ['node', 'flippy',];
 
   /**
    * Disable schema validation.
@@ -26,7 +26,7 @@ class FlippyTest extends BrowserTestBase {
   /**
    * {@inheritdoc}
    */
-  public function setUp() {
+  public function setUp(): void {
     parent::setUp();
 
     // Create an article content type that we will use for testing.
@@ -71,8 +71,8 @@ class FlippyTest extends BrowserTestBase {
     $this->assertSession()->statusCodeEquals(200);
 
     // Confirm that the front page contains the standard text.
-    $this->assertNoText('Previous');
-    $this->assertText('Next');
+    $this->assertSession()->pageTextNotContains('Previous');
+    $this->assertSession()->pageTextContains('Next');
 
     // Load the second page.
     $this->drupalGet('/node/2');
@@ -81,8 +81,8 @@ class FlippyTest extends BrowserTestBase {
     $this->assertSession()->statusCodeEquals(200);
 
     // Confirm that the front page contains the standard text.
-    $this->assertText('Previous');
-    $this->assertText('Next');
+    $this->assertSession()->pageTextContains('Previous');
+    $this->assertSession()->pageTextContains('Next');
 
     // Load the last page.
     $this->drupalGet('/node/3');
@@ -91,8 +91,8 @@ class FlippyTest extends BrowserTestBase {
     $this->assertSession()->statusCodeEquals(200);
 
     // Confirm that the front page contains the standard text.
-    $this->assertText('Previous');
-    $this->assertNoText('Next');
+    $this->assertSession()->pageTextContains('Previous');
+    $this->assertSession()->pageTextNotContains('Next');
   }
 
 }
