1 Commits
Author SHA1 Message Date
TheWitness 38ea27b74e test: add coverage for a few uncovered pure setup.php helpers (#827)
* test: add coverage for a few uncovered pure setup.php helpers

setup.php has a handful of small, pure/near-pure functions that had no
test coverage at all: plugin_thold_check_config(),
thold_check_dependencies(), plugin_thold_check_strict(),
thold_multiexplode(), and the *_action_array() menu-entry helpers
(thold_device_action_array()/thold_data_source_action_array()/
thold_graphs_action_array()/thold_clog_regex_array()).

Added tests/Unit/SetupSmallHelpersTest.php covering all of these,
reusing this repo's existing CactiStubs recording/programmable stub
convention.

Deliberately narrow in scope: this plugin's setup.php also contains
much larger, deeply domain-specific functions (device/graph/data-source
action execute/prepare, SNMP agent cache install/uninstall, device
template editors, etc.) that are intentionally left untouched here -
those would need dedicated, carefully-scoped fixtures of their own
rather than a speculative pass, given how large and actively developed
this plugin already is.

Verified via a real WSL Cacti install pinned to the exact release this
plugin's tests/.cacti-version expects (1.2.31, per its strict-equality
bootstrap check - not touched): 521 passed (1363 assertions), up from
511 passed before this PR (2 pre-existing PHP 8.4 deprecation notices
in thold_functions.php's RPN evaluator are unrelated to this change).

* Apply full GPL v2 license header to SetupSmallHelpersTest.php
2026-09-23 08:08:39 -04:00