Skip to content

Cover the command registry, the backup prompt and two grid branches - #721

Merged
blaipr merged 1 commit into
mainfrom
test/cli-registry-and-grid
Aug 13, 2026
Merged

Cover the command registry, the backup prompt and two grid branches#721
blaipr merged 1 commit into
mainfrom
test/cli-registry-and-grid

Conversation

@blaipr

@blaipr blaipr commented Aug 13, 2026

Copy link
Copy Markdown
Member

What

4 tests on the last small gaps in the CLI and grid plumbing.

  • The command registryCliCommandHelper::getCommands() is the whole sp:* list. An entry dropped from it disappears from the command line with nothing else anywhere to catch it, so it is asserted as the exact list, in order.
  • The backup command's interactive path prompt, which had never been driven.
  • Two branches of the grid every management screen renders through: updating the pager when there is none attached is a no-op rather than a failure, and the template check's success path — only its failure was covered.

Left alone deliberately

  • The backup's not-installed guard sits behind !defined('TEST_ROOT'), which the suite defines for the whole process — structurally unreachable from any test in it.
  • The XML export's three catch blocks around DOMDocument cannot be reached through any input: the document is built internally, and invalid text content is sanitised by ext-dom rather than raising. Confirmed experimentally rather than assumed.
  • A handful of plain accessors on the grid with no branching, including a $tableTemplate property that has no setter anywhere in the codebase.

One defect found, fixed separately

XmlExport::export() deletes the previous export before writing the new one, so a run that fails part-way destroys the last good export rather than leaving it in place. BackupFile::doBackup() has the same ordering. That is its own change.

Testing

Unit: 13 green across the touched classes. Integration: 6 green on the backup command.

The CLI registry is the whole sp:* command list; an entry dropped from it
disappears from the command line with nothing else anywhere to catch it, so it
is asserted as the exact list, in order.

Plus the backup command's interactive path prompt, and two branches of the grid
every management screen renders through: updating the pager when there is none
attached is a no-op rather than a failure, and the template check's success
path, which only had its failure covered.

Two things left alone deliberately: the backup's not-installed guard sits behind
!defined('TEST_ROOT'), which the suite defines for the whole process, and the
XML export's three catch blocks around DOMDocument cannot be reached through any
input — the document is built internally, and invalid text is sanitised by the
extension rather than raising.
@blaipr
blaipr merged commit 7870327 into main Aug 13, 2026
8 checks passed
@blaipr
blaipr deleted the test/cli-registry-and-grid branch August 13, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant