Problem/Motivation

Part of deprecating Shortcut. Starting off my addressing are the easiest tests to take care of.

Steps to reproduce

Proposed resolution

Move some test coverage to the shortcut module.

BlockInstallTest.php - not sure why shortcut is installed on this.

Remaining tasks

User interface changes

Introduced terminology

API changes

Data model changes

Release notes snippet

Issue fork drupal-3569152

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

quietone created an issue. See original summary.

andypost made their first commit to this issue’s fork.

andypost’s picture

Status: Active » Needs review

I think few more tests could be moved but now it pass

Tests that should likely be moved to shortcut module

These are dedicated shortcut tests that would need to go with the module to contrib:

1. core/modules/navigation/tests/src/Functional/NavigationShortcutsBlockTest.php — Extensive testing of shortcuts in the Navigation block (creation, caching,
permissions, deletion). This is shortcut-specific test coverage.
2. core/modules/jsonapi/tests/src/Functional/JsonApiFilterRegressionTest.php — Has a test method that creates shortcut entities to test JSON:API filtering
(issue #3015759). Partial shortcut concern.
3. core/modules/filter/tests/src/Kernel/EntityLinksTest.php — Has a testShortcutEntity() method testing entity links with shortcuts.

Tests that reference shortcut but are testing other things

These just use shortcut as a dependency (e.g. for Claro schema validation) and would need to be updated to conditionally depend on or stop requiring shortcut:

- Claro theme tests (3 files) — install shortcut just for claro.settings schema validation
- ToolbarClaroOverridesTest.php — shortcut as dependency for toolbar testing
- NavigationBlockUiTest.php — shortcut permissions in modules list
- ConfigTranslationListUiTest.php — shortcut sets in config translation
- EntityOperationsCacheabilityTest.php — tests shortcut_set operations cacheability
- BigPipePlaceholderTestCases.php — hardcoded shortcut URL as test data

Recipe/installation tests #3571079: Remove Shortcut module from recipes

- StandardRecipeInstallTest.php and StandardRecipeTest.php — assert that 2 default shortcuts exist after Standard recipe install. These will need updating.
- ConfigActionValidationTest.php — tests shortcut_set config entity validation

andypost’s picture

Claro related tests should stay here untouched so in deprecation issue/removal issue we can remove hardcoded config schema for mobile_link in third-party of theme settings and clean-up shortcut_install() from Claro chages (module already providing scherma for this link so oliviero theme can be cleaned too)

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for picking these up @andypost

For deprecations I'll be doing several laps so will make sure we get the theme ones. I haven't opened a ticket yet as I'm waiting for more modules/lib components to land first as they also chip away at those.

catch’s picture

Status: Reviewed & tested by the community » Needs work

Needs a rebase for the phpstan baseline but otherwise looks good.

andypost’s picture

Status: Needs work » Reviewed & tested by the community

rebased

  • longwave committed 6e7257fe on main
    refactor: #3569152 Move some test coverage to shortcut module
    
    By:...
longwave’s picture

Version: main » 11.x-dev
Status: Reviewed & tested by the community » Patch (to be ported)

Committed 6e7257f and pushed to main. Thanks!

There is a conflict in the PHPStan baseline on 11.x, but this also needs to land there, so keeping open for backport.

andypost’s picture

Status: Patch (to be ported) » Needs review

cherry-picked commit to new MR, tests running

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for taking care of this @andypost

quietone’s picture

Title: Move some test coverage to shortcut module » Move some test coverage to the Shortcut module

  • catch committed 97564a5b on 11.x
    task: #3569152 Move some test coverage to the Shortcut module
    
    By:...
catch’s picture

Status: Reviewed & tested by the community » Fixed

Committed/pushed to 11.x, thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.