diff --git a/src/Entity/Flag.php b/src/Entity/Flag.php
index 2c440bc..8de581b 100644
--- a/src/Entity/Flag.php
+++ b/src/Entity/Flag.php
@@ -313,7 +313,7 @@ class Flag extends ConfigEntityBundleBase implements FlagInterface {
     if (empty($bundles)) {
       // If the setting is empty, return all bundle names for the flag's entity
       // type.
-      $bundle_info = entity_get_bundles($this->entity_type);
+      $bundle_info = \Drupal::entityManager()->getBundleInfo($this->entity_type);
       $bundles = array_keys($bundle_info);
     }
 
diff --git a/src/Form/FlagFormBase.php b/src/Form/FlagFormBase.php
index d4147b0..5a3666b 100644
--- a/src/Form/FlagFormBase.php
+++ b/src/Form/FlagFormBase.php
@@ -127,7 +127,7 @@ abstract class FlagFormBase extends EntityForm {
     $flag_type_plugin = $flag->getFlagTypePlugin();
     $flag_type_def = $flag_type_plugin->getPluginDefinition();
 
-    $bundles = entity_get_bundles($flag_type_def['entity_type']);
+    $bundles = \Drupal::entityManager()->getBundleInfo($flag_type_def['entity_type']);
     $entity_bundles = [];
     foreach ($bundles as $bundle_id => $bundle_row) {
       $entity_bundles[$bundle_id] = $bundle_row['label'];
diff --git a/src/Tests/FlagFieldEntryTest.php b/src/Tests/FlagFieldEntryTest.php
index 44b17ac..a8eacbc 100644
--- a/src/Tests/FlagFieldEntryTest.php
+++ b/src/Tests/FlagFieldEntryTest.php
@@ -143,7 +143,7 @@ class FlagFieldEntryTest extends WebTestBase {
    */
   public function doAddFields() {
     // Check the Field UI tabs appear on the flag edit page.
-    $this->drupalGet('admin/structure/flags/manage/' . $this->id);
+    $this->drupalGet('admin/structure/flags/manage/' . $this->id . '/fields');
     $this->assertText(t("Manage fields"), "The Field UI tabs appear on the flag edit form page.");
 
     $this->fieldUIAddNewField('admin/structure/flags/manage/' . $this->id, $this->flagFieldId, $this->flagFieldLabel, 'text');
diff --git a/src/Tests/FlagTestBase.php b/src/Tests/FlagTestBase.php
index e532225..ac2ddc7 100644
--- a/src/Tests/FlagTestBase.php
+++ b/src/Tests/FlagTestBase.php
@@ -64,7 +64,7 @@ abstract class FlagTestBase extends WebTestBase {
 
     // If we didn't get a subtype, assume all subtypes for the entity.
     if (empty($bundles)) {
-      $bundles = array_keys(entity_get_bundles($entity_type));
+      $bundles = array_keys(\Drupal::entityManager()->getBundleInfo($entity_type));
     }
 
     // If we didn't get a link type, assume 'reload'.
@@ -134,7 +134,7 @@ abstract class FlagTestBase extends WebTestBase {
     $final_edit = array_merge($default_edit, $edit);
 
     // Check if any of the bundles have been set.
-    $bundles = array_keys(entity_get_bundles($entity_type));
+    $bundles = array_keys(\Drupal::entityManager()->getBundleInfo($entity_type));
     $has_specified_bundle = FALSE;
     foreach ($bundles as $bundle_id) {
       if (!empty($final_edit['bundles[' . $bundle_id . ']'])) {
