It's all in the title.

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

mably created an issue. See original summary.

mably’s picture

Status: Active » Needs review

Added comprehensive test coverage across the module and its term_glossary_per_node submodule — 14 files changed, 2055 insertions, 5 deletions.

New test files (11)

Kernel tests

  • TermGlossaryManagerTest — 18 tests for the core service: empty input, invalid UTF-8, basic/multiple term matching, case-sensitive/insensitive, full-word matching with boundary exceptions, single match per field/content, exclude self-reference, ignore tags, link/glossary-exclude class exclusion, handler resolution, config retrieval, term caching.
  • TermGlossaryControllerTest — 6 tests for the JSON API endpoints: letter search (valid/invalid), term-by-ID (found/not found), search-per-term (CONTAINS match/no results).
  • GlossaryAlphabeticalBockTest — 7 tests for the block plugin: default configuration, build output for all three search_type variants, form structure, form default value reflection, submit handler.
  • TermGlossaryPerNodeManagerTest — 5 tests for the per-node service decorator: service override verification, vocabulary resolution with per-node override, formatter third-party settings (active/inactive/non-node entity).

Unit tests

  • TermGlossaryLinkHandlerTest — 1 test for the link handler plugin: term wrapping with link URL, CSS class, and tid in URL options.
  • TermGlossaryCustomJSHandlerTest — 2 tests for the custom JS handler plugin: term wrapping with data attributes and CSS classes, and HTML escaping of term names.
  • TermGlossaryPerNodeHooksTest — 2 tests for per-node hook callbacks: entityBaseFieldInfo() returns fields for node type and empty array for non-node types.
  • TermGlossaryUtilsTest — 6 tests for the utility class: per-node settings retrieval (active/inactive/missing type), vocabulary resolution with/without override.

Functional tests

  • TermGlossaryRenderTest — 2 tests for end-to-end rendering: glos-term markup appears when glossary is enabled on a field, absent when disabled.
  • TermGlossaryConfigFormTest — 2 tests for the admin config form: successful submission and access denied for anonymous users.

Shared trait

  • GlossaryTestTrait — extracts duplicated setUp boilerplate (installGlossaryTestDependencies()) and the createGlossaryTerm() helper into a reusable trait shared by all 4 kernel tests and the functional render test.

Modified files (3)

  • TermGlossaryPerNodeTest — added detailed PHPDoc descriptions to testNodeFormSettings() and testDisablingOverride().
  • TermGlossaryHooksTest — added detailed PHPDoc descriptions to all test methods, renamed $result variables to $form_elements for clarity.
  • .cspell-project-words.txt — added zzzznotfound (used in controller test).

  • mably committed de18f582 on 4.x
    task: #3576078 Improve test coverage
    
    By: mably
    
mably’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.