Problem/Motivation

Would be great to have tests to ensure the module works as expected. Shouldn't be too hard, as the module is not that complicated. So I'll tag this as novice task.

The tests should include

  1. Create dummy content, like nodes or taxonomy terms
  2. Placing a block of this type for a certain menu
  3. Use the default block settings and ensure the results appear as expected
  4. Ensure the block is present and shows up as expected
  5. Adjust all settings one by one and ensure things go as expected

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

CommentFileSizeAuthor
#8 screenshot-2025-11-05 14_50_10.png34.61 KBgrevil
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

anybody created an issue. See original summary.

faust74’s picture

I haven’t written tests before, but I want to learn how to do so. I’ll give this task a try and keep you updated on my progress.

anybody’s picture

Thank you @faust74! Looking very much forward to that! Feel free to ask here, if you should have any questions.

These snippets and tests from core may help, maybe!

miroslavstankov’s picture

Assigned: Unassigned » miroslavstankov

I see this issue has been inactive for a while, and I’d like to start working on it.

miroslavstankov’s picture

Assigned: miroslavstankov » Unassigned
Status: Active » Needs review

Add functional tests and config schema, migrate to PHP attributes
- Add functional tests covering all block settings and rendering scenarios
- Add config/schema/entity_submenu_block.schema.yml extending block.settings.system_menu_block:* with view_mode_* definitions for node, taxonomy_term, media, user block_content, comment, and contact_message entity types
- Migrate EntitySubmenuBlock to PHP 8 #[Block] attribute with ::class constant for deriver

grevil’s picture

Status: Needs review » Needs work
grevil’s picture

Issue tags: -Novice, -Needs tests
StatusFileSize
new34.61 KB

Ok, this issue escalated a bit, but I removed the weird config workarounds in the Block and adjusted the settings structure.

The update hook works as expected:
screenshot

grevil’s picture

Title: Write tests for the module and its settings » Write tests, implement schema, drop D8/9 support, adjust block settings structure
grevil’s picture

Status: Needs work » Needs review

All done, please review!

miroslavstankov’s picture

Thank you for reviewing and fixing those things.

anybody’s picture

Status: Needs review » Needs work

Left one comment. LGTM otherwise, thank you!!

grevil’s picture

Status: Needs work » Needs review
anybody’s picture

Status: Needs review » Fixed

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.

anybody’s picture