Skip to content

tests: triage admin page one-off PHPUnit regressions #1507

Description

@superdav42

Summary

Several admin-page tests have isolated regressions in rendering, columns, redirect/header handling, screen gating, and settings filtering.

Full-suite evidence from the current run:

  • Command: vendor/bin/phpunit --log-junit phpunit-results.xml
  • Result: Tests: 10012, Assertions: 25932, Errors: 468, Failures: 96, Skipped: 56, Risky: 1
  • This group accounts for 8 failing/error/risky result(s).

Failure evidence

  • 2 × Error: Call to a member function get_all_products() on false
  • 2 × Failed asserting that an array has the key 'sites'.
  • 1 × Undefined variable $page_title
  • 1 × Cannot modify header information - headers already sent by (output started at /tmp/wordpress-tests-lib/includes/bootstrap.php:261)
  • 1 × Failed asserting that true is false.
  • 1 × Array values should be excluded from settings
Location Test Failure detail
tests/Admin_Pages/Wizard_Admin_Page_Test.php:809 WP_Ultimo\Admin_Pages\Wizard_Admin_Page_Test::test_output_runs_without_error Error: Call to a member function get_all_products() on false
tests/WP_Ultimo/Admin/Network_Usage_Columns_Test.php:57 WP_Ultimo\Admin\Network_Usage_Columns_Test::test_add_plugins_column Failed asserting that an array has the key 'sites'.
tests/WP_Ultimo/Admin/Network_Usage_Columns_Test.php:67 WP_Ultimo\Admin\Network_Usage_Columns_Test::test_add_themes_column Failed asserting that an array has the key 'sites'.
tests/WP_Ultimo/Admin_Pages/Customer_Panel/Template_Switching_Admin_Page_Test.php:219 WP_Ultimo\Admin_Pages\Customer_Panel\Template_Switching_Admin_Page_Test::test_output_renders Undefined variable $page_title
tests/WP_Ultimo/Admin_Pages/Debug/Debug_Admin_Page_Test.php:241 WP_Ultimo\Admin_Pages\Debug\Debug_Admin_Page_Test::test_output_renders_template Error: Call to a member function get_all_products() on false
tests/WP_Ultimo/Admin_Pages/Migration_Alert_Admin_Page_Test.php:256 WP_Ultimo\Admin_Pages\Migration_Alert_Admin_Page_Test::test_handle_proceed_deletes_options_and_redirects Cannot modify header information - headers already sent by (output started at /tmp/wordpress-tests-lib/includes/bootstrap.php:261)
tests/WP_Ultimo/Admin_Pages/Multisite_Setup_Admin_Page_Test.php:517 WP_Ultimo\Admin_Pages\Multisite_Setup_Admin_Page_Test::test_register_scripts_does_not_enqueue_on_wrong_screen Failed asserting that true is false.
tests/WP_Ultimo/Admin_Pages/System_Info_Admin_Page_Test.php:690 WP_Ultimo\Admin_Pages\System_Info_Admin_Page_Test::test_get_all_wp_ultimo_settings_excludes_array_values Array values should be excluded from settings

Files to inspect

  • tests/Admin_Pages/Wizard_Admin_Page_Test.php
  • tests/WP_Ultimo/Admin/Network_Usage_Columns_Test.php
  • tests/WP_Ultimo/Admin_Pages/Customer_Panel/Template_Switching_Admin_Page_Test.php
  • tests/WP_Ultimo/Admin_Pages/Debug/Debug_Admin_Page_Test.php
  • tests/WP_Ultimo/Admin_Pages/Migration_Alert_Admin_Page_Test.php
  • tests/WP_Ultimo/Admin_Pages/Multisite_Setup_Admin_Page_Test.php
  • tests/WP_Ultimo/Admin_Pages/System_Info_Admin_Page_Test.php
  • inc/admin-pages/class-wizard-admin-page.php
  • inc/admin/class-network-usage-columns.php
  • inc/admin-pages/customer-panel/class-template-switching-admin-page.php
  • inc/admin-pages/debug/class-debug-admin-page.php
  • inc/admin-pages/class-migration-alert-admin-page.php
  • inc/admin-pages/class-multisite-setup-admin-page.php
  • inc/admin-pages/class-system-info-admin-page.php

Investigation guidance

  1. Triage each failure independently; do not assume a single root cause for this issue.
  2. For render tests, inspect whether required product/settings fixtures now need explicit setup or whether page code should guard missing dependencies.
  3. For redirect/header tests, verify the test captures/halts redirects without relying on already-sent output.
  4. For screen-gating and settings-filter assertions, compare the expected behavior with current admin UX requirements before changing assertions.

Required decision for this task: identify whether each failure is caused by stale/ineffective test code or by a regression in production code. If the test is stale, update it so it still protects the intended behavior. If production regressed, fix production code and keep/add a regression assertion.

Also review the affected tests for effectiveness: remove false positives, avoid overfitting to implementation details, and do not weaken assertions without replacing them with behavior-focused coverage.

Reference pattern

Use the existing tests in the same test file/class as the first reference pattern. Preserve their fixture style where it still models real Ultimate Multisite behavior, but update stale setup or assertions when current product behavior has intentionally changed. For production fixes, mirror nearby wu_create_*() and manager/model test patterns rather than adding broad global test bootstrap changes unless the root cause is truly suite-wide.

Acceptance criteria

  • The affected filtered PHPUnit command(s) pass without errors, failures, or risky tests.
  • Any production-code fix is covered by a test that would fail before the fix.
  • Any test-code update documents or demonstrates the intended product behavior.
  • No global suppression of warnings/notices is introduced to hide the failure.
  • Relevant PHPCS/PHPStan checks pass for changed PHP files.

Verification

Run the focused checks first:

  • vendor/bin/phpunit --filter Wizard_Admin_Page_Test
  • vendor/bin/phpunit --filter Network_Usage_Columns_Test
  • vendor/bin/phpunit --filter Template_Switching_Admin_Page_Test
  • vendor/bin/phpunit --filter Debug_Admin_Page_Test
  • vendor/bin/phpunit --filter Migration_Alert_Admin_Page_Test
  • vendor/bin/phpunit --filter Multisite_Setup_Admin_Page_Test
  • vendor/bin/phpunit --filter System_Info_Admin_Page_Test

Then run broader checks as appropriate before PR handoff:

  • vendor/bin/phpunit
  • vendor/bin/phpcs <changed PHP files>
  • vendor/bin/phpstan analyse

aidevops.sh v3.21.12 plugin for OpenCode v1.17.9 with gpt-5.5 spent 25m and 18,325 tokens on this with the user in an interactive session. Overall, 2m since this issue was created.

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingorigin:interactiveCreated by interactive user sessionpriority:highHigh severity — significant quality issuetestingtier:standardAuto-created by pulse labelless backfill (t2112)

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions