Repository navigation
test(wizard): share the wizard stand-ins between the two wizard test files; drop skips for fixed defects - #969
Merged
Merged
Conversation
…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>
|
Contributor
There was a problem hiding this comment.
🟢 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
xmacan
approved these changes
Dec 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Problem
developfails CI on every PHP version since #962 and #964 merged together:tests/Behaviour/GraphWizardTest.php(#962) andtests/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) andload_current_session_value()(parameter names only). In CI the unit file loads first, so the behaviour scenario read''.GraphWizardTest.phpalso failed on its own ondevelop(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:
ThresholdWizardAuthorizationTest'shtml_graph_custom_data(),encode_data_query_index()andform_save_button()now matchGraphWizardTest's. Its two assertions on the recorded device and device template read the first two recorded parameters through a smallcustomDataDevices()helper. This also removes themd5()SonarCloud flagged on fix(wizard): check graph and device permission in the threshold wizard; drop stale breadcrumbs #964.GraphWizardTestgets the sameis_device_allowed()stand-in as the unit file.Verification
WSL, PHP 8.3.36, Cacti
1.2.x, from the Cacti root with--configuration=plugins/thold/phpunit.xml:--order-by=random.