To run tests from within the web directory: /var/www/drupal/web # ../vendor/bin/phpunit -c core modules/contrib/json_field_processor/tests/src/Functional
Test Coverage
Test Case | Test Steps | Expected Outcome | Covered Functionalities |
---|---|---|---|
Permissions Check | 1) Access restricted paths as an anonymous user and a user without permissions. | 403 status code on restricted paths for anonymous and non-permissioned users. | Permissions for paths: /admin/json-field-processor/json_field_processor_config , /admin/json-field-processor/json_field_processor_config/add |
Permissions Check (Admin User) | 2) Log in as an admin user who can administer JSON field processor configurations. | Access to restricted paths returns a 200 status code for admin users. | Admin permissions to access and manage JSON field processor configurations. |
Entity Management (Create) | 3) Go to the list page and click "Add JSON Field Processor Configuration". | Ability to create a JSON Field Processor Configuration entity. | Create functionality for json_field_processor_config entity. |
Entity Management (Edit) | 4) Edit the configuration after creation and verify the pre-filled values. | Values pre-filled correctly in the edit form (e.g., label, field name, json path). | Edit functionality for json_field_processor_config entity. |
Entity Listing | 5) Verify that the created entity appears in the list with the correct label and field name. | Created entities are listed correctly with the values displayed. | Listing and displaying entities in the UI. |
Entity Management (Create Another) | 6) Create a second json_field_processor_config entity with different values. |
New configuration appears in the list with correct values. | Ability to add multiple configurations and display them. |
Links Verification on Listing Page | 7) Check links for adding, viewing, and deleting configurations on the listing page. | Links for adding, viewing, and deleting configurations should exist. | Link existence for managing configurations (add, edit, delete). |
Links Verification on Add/Edit Page | 8) Verify links on the Add and Edit configuration pages. | Links to manage (edit, delete) configurations should be present. | Links for managing configurations in add/edit pages. |
Deletion Workflow | 9) Go to the delete page of a configuration and verify the delete button. | "Delete" button is present on the delete confirmation page. | Deletion functionality for configurations. |
Cancel Button on Delete Page | 10) Verify that clicking the cancel button redirects to the list page. | Clicking cancel should return to the listing page. | Cancel button functionality on delete page. |