Skip to content

test(wizard): share the wizard stand-ins between the two wizard test files; drop skips for fixed defects - #969

Merged
TheWitness merged 1 commit into
developfrom
fix/wizard-test-stub
Dec 5, 2026
Merged

TheWitness merged 1 commit into
developfrom
fix/wizard-test-stub

Conversation

@TheWitness

Copy link
Copy Markdown
Member

Problem

develop fails CI on every PHP version since #962 and #964 merged together:

⨯ Feature: the wizard walks the administrator to a new threshold → a template, a graph template and a device hand the new graph on to the graph creation form
Failed asserting that two strings are identical. -'cg' +''
Tests: 1 failed, 33 skipped, 2400 passed

tests/Behaviour/GraphWizardTest.php (#962) and tests/Unit/ThresholdWizardAuthorizationTest.php (#964) both define file-scope stand-ins for the same Cacti core functions. Whichever file loads first serves both, and four of the pairs differed: html_graph_custom_data() (#964's recorded no form type and only two parameters), encode_data_query_index() (md5() vs 'enc-'), form_save_button() (#964's did not record the cancel URL) and load_current_session_value() (parameter names only). In CI the unit file loads first, so the behaviour scenario read ''.

GraphWizardTest.php also failed on its own on develop (Call to undefined function is_device_allowed()): #964 added that check to the wizard, and only the unit file defined a stand-in for it.

Change

Test-only:

Verification

WSL, PHP 8.3.36, Cacti 1.2.x, from the Cacti root with --configuration=plugins/thold/phpunit.xml:

  • Full suite: 2401 passed, 22 skipped, 0 failed (was 1 failed, 33 skipped); the same with --order-by=random.
  • The two wizard files together in both orders: 23 passed, 0 skipped.
  • Each of the five behaviour files that lost a skip, run on its own: all pass.

…files; drop skips for fixed defects

#962 and #964 merged together, and each defines file-scope stand-ins for the
same Cacti core functions. Whichever file loads first serves both, and they
recorded different things, so develop fails "a template, a graph template and
a device hand the new graph on to the graph creation form" in CI on every PHP
version.

- ThresholdWizardAuthorizationTest's html_graph_custom_data(),
  encode_data_query_index() and form_save_button() stand-ins now match
  GraphWizardTest's; its two assertions read the device and device template
  from the first two recorded parameters.
- GraphWizardTest gets the is_device_allowed() stand-in the wizard needs since
  #964, so the file also passes on its own.
- Remove the skips #962 added for #954, #956, #957, #958, #959 and #960, which
  #961, #963, #964 and #965 fixed. All eleven scenarios pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings December 5, 2026 12:05
@sonarqubecloud

sonarqubecloud Bot commented Dec 5, 2026

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for this test-only update aligning wizard stand-ins and restoring regression coverage.

No open issues 🎉

What changed in this PR

This test-only PR aligns the wizard test stand-ins to eliminate load-order failures and restores regression coverage for defects fixed in earlier PRs. Production code is unchanged.

Changes:

  • Align wizard helper recording and update authorization assertions.
  • Add the device-permission stand-in needed to run wizard behaviour tests independently.
  • Remove eleven skips covering previously fixed defects.
File Description
tests/​Unit/​ThresholdWizardAuthorizationTest.php Aligns stand-ins and adapts device assertions.
tests/​Behaviour/​SettingsAndNavigationTest.php Enables breadcrumb regression coverage.
tests/​Behaviour/​RpnOperatorEdgeCasesTest.php Enables seven RPN regression scenarios.
tests/​Behaviour/​GraphWizardTest.php Adds permission stand-in and enables graph authorization coverage.
tests/​Behaviour/​DeviceStatusNotificationsTest.php Enables queued command environment isolation coverage.
tests/​Behaviour/​BaselineReferenceTest.php Enables consolidation-function baseline coverage.

Review effort: Balanced

@TheWitness
TheWitness merged commit b741adf into develop Dec 5, 2026
8 checks passed
@TheWitness
TheWitness deleted the fix/wizard-test-stub branch December 5, 2026 13:56
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.

3 participants