diff --git a/core/modules/system/tests/modules/entity_schema_test/src/Hook/EntitySchemaTestHooks.php b/core/modules/system/tests/modules/entity_schema_test/src/Hook/EntitySchemaTestHooks.php
index 13f98abde52..4fb9af8552b 100644
--- a/core/modules/system/tests/modules/entity_schema_test/src/Hook/EntitySchemaTestHooks.php
+++ b/core/modules/system/tests/modules/entity_schema_test/src/Hook/EntitySchemaTestHooks.php
@@ -68,7 +68,7 @@ public function entityFieldStorageInfo(EntityTypeInterface $entity_type) {
     public function entityBundleFieldInfo(EntityTypeInterface $entity_type, $bundle) {
       if ($entity_type->id() == 'entity_test_update' && $bundle == 'custom') {
         /** @var \Drupal\Core\Field\FieldStorageDefinitionInterface $custom_bundle_field_storage */
-        $custom_bundle_field_storage = \entity_schema_test_entity_field_storage_info($entity_type)['custom_bundle_field'];
+        $custom_bundle_field_storage = $this->entityFieldStorageInfo($entity_type)['custom_bundle_field'];
         $definitions[$custom_bundle_field_storage->getName()] = FieldDefinition::createFromFieldStorageDefinition($custom_bundle_field_storage);
         return $definitions;
       }
diff --git a/core/tests/Drupal/KernelTests/Core/Common/DrupalFlushAllCachesTest.php b/core/tests/Drupal/KernelTests/Core/Common/DrupalFlushAllCachesTest.php
index bacbc6d1d1f..260664de486 100644
--- a/core/tests/Drupal/KernelTests/Core/Common/DrupalFlushAllCachesTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Common/DrupalFlushAllCachesTest.php
@@ -5,6 +5,7 @@
 namespace Drupal\KernelTests\Core\Common;
 
 use Drupal\Core\DependencyInjection\ContainerBuilder;
+use Drupal\system_test\Hook\SystemTestHooks;
 use Drupal\KernelTests\KernelTestBase;
 
 /**
@@ -46,7 +47,7 @@ public function testDrupalFlushAllCachesModuleList(): void {
     sort($container_modules);
     $this->assertSame($module_list, $container_modules);
     $this->assertSame(1, $this->containerBuilds);
-    $this->assertTrue(function_exists('system_test_help'));
+    $this->assertTrue(method_exists(SystemTestHooks::class, 'help'));
 
     $core_extension->clear('module.system_test')->save();
     $this->containerBuilds = 0;
