Problem/Motivation
tsk module tests are solid for tsk_admin (Controller, Form, both Drush Commands) but have gaps in two areas:
1. src/Services/TskService::kill() — core validation logic untested
tests/src/Kernel/TskServiceTest.php only covers the happy path (delete one key, delete all). None of the module's own exception types are exercised directly against the service:
• empty/whitespace $collection → \InvalidArgumentException
• invalid $type (not private/shared) → InvalidTempstoreTypeException
• $kill_all = FALSE with empty $key → \InvalidArgumentException
• non-existent private key → TempstoreKeyNotFoundException
• non-existent shared key → TempstoreKeyNotFoundException
• default $type parameter (call kill($collection) only, expect private)
These are currently only indirectly touched via TskCommandsTest (Functional/Drush), whose assertions use logicalOr(..., isEmpty()), which pass even if the underlying exception behavior silently breaks. Direct Kernel-level tests on TskService are needed to pin down the actual contract.
2. tsk_admin — two untested classes
• TskEntityListBuilder (header/row building, edit/delete/kill operation links, empty-state markup, the kill_all_link) has zero coverage. No test ever requests the entity list page /admin/config/development/tsk itself.
• TskEntityDeleteForm (submitForm, getQuestion, getCancelUrl, and its EntityStorageException / generic \Exception catch branches) has zero coverage.
Issue fork tsk-3630265
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
Comment #3
drupatz commented