diff --git a/tests/src/Functional/PdfWebformPopulationTest.php b/tests/src/Functional/PdfWebformPopulationTest.php
index b6fcb3aac691e1ac7ba68f9119fea7922d0a16e0..7ea9b64e78cffc3b8e74945511471699b1364dc7 100644
--- a/tests/src/Functional/PdfWebformPopulationTest.php
+++ b/tests/src/Functional/PdfWebformPopulationTest.php
@@ -44,7 +44,7 @@ class PdfWebformPopulationTest extends FillPdfTestBase {
    */
   protected function setUp() {
     // @todo: Stop skipping this test when Webform has Drupal 9 support.
-    if (version_compare('9.0.0', \Drupal::VERSION, '>=')) {
+    if (version_compare(substr(\Drupal::VERSION, 0, 1), 9, '>=')) {
       $this->markTestSkipped('Webform is not yet compatible with Drupal 9, so skipping these tests.');
     }