Expand test coverage in FieldUninstallValidatorTest

Created on 29 August 2024, 3 months ago
Updated 20 September 2024, about 2 months ago

Overview

in FieldUninstallValidatorTest we have a todo to add extra test coverage

Proposed resolution

Add as many of these test cases as we can. To be practical we don't need to do all the test cases in 1 MR we can commit it case as we finish it.

  1. Very unsure if we need to support this so don't need a test right now
  2. Field used in multiple entities of different types.

    We need a test where an experience builder field is used in another content entity type, such as user or comment, in addition to nodes.

    The expected uninstall error should show the messages for both entity types for both default values and content uses.

    The experience builder field for the test will either need to be created programmatically in the test or the xb_test_config_node_article test module could be updated to provide the field on the another content type also(the module name would need to be updated too.

    It is probably better if possible to create the field programmatically so we don't have to keep updating the test modules when we need different fields.

  3. Low priority: Test with field that does not use dedicated storage.

    See

    // Check whether the field has dedicated storage.
          if ($table_mapping->requiresDedicatedTableStorage($component_field_storage)) {
            $base_table = $table_mapping->getDedicatedDataTableName($component_field_storage);
            $revision_table = $table_mapping->getDedicatedRevisionTableName($component_field_storage);
          }
          else {
            $base_table = $table_mapping->getBaseTable();
            $revision_table = $table_mapping->getRevisionTable();
          }
    

    We only test one of these, I believe most fields fall into the 2nd case but debugging would need to confirm which case our test covers.

    Is the uncovered case common? Is there a test field we can use in a core test module or test that creates the other case that we don't test?

Any others?

User interface changes

None

📌 Task
Status

Needs work

Component

Data model

Created by

🇺🇸United States tedbow Ithaca, NY, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024