diff --git a/CRM/Utils/Check/Component/Env.php b/CRM/Utils/Check/Component/Env.php
index 1f63ec83e7d2c507ea5edb72c46fc5c1e1326d07..f239f69d526f95319e1450553825d727f6cc1096 100644
--- a/CRM/Utils/Check/Component/Env.php
+++ b/CRM/Utils/Check/Component/Env.php
@@ -751,7 +751,8 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
       }
 
       // if db.ver > code.ver, sth really wrong
-      if (version_compare($dbVersion, CRM_Utils_System::version()) > 0) {
+      $codeVersion = CRM_Utils_System::version();
+      if (version_compare($dbVersion, $codeVersion) > 0) {
         $messages[] = new CRM_Utils_Check_Message(
           __FUNCTION__,
           ts('Your database is marked with an unexpected version number: %1. The v%2 codebase may not be compatible with your database state.
diff --git a/Civi/Test/Data.php b/Civi/Test/Data.php
index 8cada62629b6cb198f3ad8cc6b5c6056bc29c390..eb4a5ef083194a7a6dc9cba68c5868eee875233d 100644
--- a/Civi/Test/Data.php
+++ b/Civi/Test/Data.php
@@ -44,6 +44,8 @@ class Data {
       \Civi\Test::schema()->setStrict(TRUE);
     });
 
+    civicrm_api('setting', 'create', ['installed' => 1, 'domain_id' => 'all', 'version' => 3]);
+
     // Rebuild triggers
     civicrm_api('system', 'flush', ['version' => 3, 'triggers' => 1]);
 
diff --git a/sql/test_data_second_domain.mysql b/sql/test_data_second_domain.mysql
index a0cf296334f90e1d85d38fa5d227d30c0dcb562a..9d78b106066ff7e976bb67300dbd9c54a4684960 100644
--- a/sql/test_data_second_domain.mysql
+++ b/sql/test_data_second_domain.mysql
@@ -963,4 +963,4 @@ INSERT INTO civicrm_navigation
 VALUES
     ( @domainID, CONCAT('civicrm/report/instance/', @instanceID,'&reset=1'), 'Mailing Detail Report', 'Mailing Detail Report', 'administer CiviMail', 'OR', @reportlastID, '1', NULL, @instanceID+2 );
 UPDATE civicrm_report_instance SET navigation_id = LAST_INSERT_ID() WHERE id = @instanceID;
-UPDATE civicrm_domain SET version = '5.28.alpha1';
+UPDATE civicrm_domain SET version = '5.27.2';