Skip to:
Content

bbPress.org

Opened 6 weeks ago

Closed 3 weeks ago

#3706 closed task (blessed) (fixed)

Expand PHPUnit coverage beyond incomplete stubs

Reported by: johnjamesjacoby Owned by: johnjamesjacoby
Priority: normal Milestone: 2.7
Component: Tools - Unit Tests Version: trunk
Severity: normal Keywords: needs-unit-tests
Cc:

Description

The original incomplete-test backlog in #3695 is complete. Continue auditing bbPress one source file or component at a time for behavior that never had a placeholder, was intentionally skipped, or lacks meaningful positive, negative, and edge-case coverage.

For each batch:

  • Compare the source file's current public and internal contracts with existing tests rather than relying on old test names or stubs.
  • Cover important branches, filters, actions, permissions, state transitions, multisite behavior, and integrations.
  • Track product defects separately and backport released-branch fixes where appropriate.
  • Run focused tests, standard and multisite suites, BuddyPress where relevant, PHP lint, PHPCS, and applicable CI.
  • Keep changes small and reviewable, and link each canonical Subversion revision here.

Known integration follow-ups should remain separate tickets when they involve product behavior rather than test coverage alone.

Change History (76)

#1 @johnjamesjacoby
6 weeks ago

In 7830:

Core: Add the public threaded-replies filter.

Preserve the legacy underscored filter, then pass its result through bbp_allow_threaded_replies so extensions can use the public option API consistently. Add comprehensive coverage for core option defaults, lifecycle hooks, preloading strategies, feature flags, numeric settings, integration modes, and slugs.

In trunk, for 2.7.

See #3706.
See #3707.

#2 @johnjamesjacoby
6 weeks ago

In 7832:

Tests: Add core capability coverage.

Add direct coverage for capability maps, dynamic role lifecycle, filters, actions, WordPress role mutations, recursion guards, deprecated helpers, and cleanup behavior.

In trunk, for 2.7.

See #3706.

#3 @johnjamesjacoby
6 weeks ago

In 7857:

Tests: Expand core cache coverage.

Add direct coverage for legacy cache-suspension compatibility, post-cache recursion, cache actions, root invalidation, and user-count cache invalidation. Correct existing child-cache assertions so they use the intended cache-key hashes.

In trunk, for 2.7.

See #3706, #3713.

#4 @johnjamesjacoby
6 weeks ago

In 7860:

Tests: Add core template-loader coverage.

Add direct coverage for template interception, theme-functions loading, selector precedence, template candidate hierarchies, block canvas filtering, and deprecated compatibility.

In trunk, for 2.7.

See #3706.

#5 @johnjamesjacoby
6 weeks ago

In 7863:

Tests: Add core extension-loader coverage.

Add direct coverage for unavailable integrations, the Akismet setup hook, the legacy BuddyPress helper, maintenance-mode handling, and state restoration.

In trunk, for 2.7.

See #3706.

#6 @johnjamesjacoby
6 weeks ago

In 7866:

Core: Improve template function coverage.

Add comprehensive coverage for template loading, asset resolution, query-state parsing, and helper contracts. Correct empty template resolution state and restore public parameter names that PHP 8 named arguments expose as part of the API.

In trunk, for 2.7.

See #3706.
See #3716.
See #3717.

#7 @johnjamesjacoby
6 weeks ago

In 7876:

Tests: Expand core function coverage.

Add direct coverage for version and asset helpers, metadata updates, view registration and queries, errors, mentions, status and rewrite IDs, rewrite cleanup, request methods, and runtime state helpers.

In trunk, for 2.7.

See #3706.

#8 @johnjamesjacoby
6 weeks ago

In 7877:

Tests: Add core action coverage.

Add direct coverage for WordPress and bbPress action bridges, lifecycle ordering, request dispatch, post transitions, filter wrappers, mail filtering, and restricted oEmbed behavior.

In trunk, for 2.7.

See #3706.

#9 @johnjamesjacoby
6 weeks ago

In 7882:

Tests: Expand theme compatibility coverage.

Add direct coverage for template package registration and state, redirects, filter preservation, comment status, and adjacent link behavior.

In trunk, for 2.7.

See #3706.

#10 @johnjamesjacoby
6 weeks ago

In 7883:

Tests: Expand core filter coverage.

Add direct coverage for legacy query-filter bridges and forum, topic, and reply sanitization filters. Exercise the content chain without depending on version-specific KSES output.

In trunk, for 2.7.

See #3706.

#11 @johnjamesjacoby
6 weeks ago

In 7886:

Tests: Cover pending upgrade helpers.

Exercise pending-upgrade storage, type filtering, counts, and menu badge output. Document helper return values and correct the remove-helper summary.

In trunk, for 2.7.

See #3706.

#12 @johnjamesjacoby
6 weeks ago

In 7887:

Tests: Cover activation redirect handling.

Exercise activation redirect bail conditions, capability checks, trigger consumption, and the successful about-page redirect.

In trunk, for 2.7.

See #3706.

#13 @johnjamesjacoby
6 weeks ago

In 7888:

Tests: Add admin bootstrap coverage.

Exercise admin action wrappers, menus, column headers, sample permalinks, slug sanitization, network-site activation, and uninstall behavior.

In trunk, for 2.7.

See #3706.

#14 @johnjamesjacoby
6 weeks ago

In 7889:

Tests: Cover admin settings helpers.

Exercise settings registries, section lookup, page and help output, forced-option state, form-option handling, and slug conflict notices.

In trunk, for 2.7.

See #3706.

#15 @johnjamesjacoby
6 weeks ago

In 7890:

Tests: Cover admin settings callbacks.

Exercise section descriptions, field markup, stored and overridden values, selected and checked state, theme packages, forum-root choices, and integration settings.

In trunk, for 2.7.

See #3706.

#16 @johnjamesjacoby
6 weeks ago

In 7893:

Tests: Cover converter settings callbacks.

Exercise converter fields, stored and overridden values, account-import permissions, and the converter page's ready and resume states.

In trunk, for 2.7.

See #3706.

#17 @johnjamesjacoby
6 weeks ago

In 7894:

Tests: Cover admin metaboxes.

Exercise dashboard statistics, content attributes, reply lists, author and moderator fields, relationship output, permissions, escaping, and extension points.

In trunk, for 2.7.

See #3706.

#18 @johnjamesjacoby
6 weeks ago

In 7895:

Tests: Cover forum administration.

Exercise forum admin hooks, help, metabox registration and saves, toggle permissions and redirects, notices, columns, row actions, update messages, and screen loading.

In trunk, for 2.7.

See #3706.

#19 @johnjamesjacoby
6 weeks ago

In 7896:

Tests: Cover topic administration.

Exercise topic admin hooks, help, bulk actions, metaboxes, toggles, notices, columns, row actions, filters, update messages, and screen loading.

In trunk, for 2.7.

See #3706.

#20 @johnjamesjacoby
6 weeks ago

In 7903:

Tests: Cover reply administration.

Exercise reply admin hooks, bulk actions, metaboxes, toggles, notices, columns, row actions, filters, update messages, and screen loading.

In trunk, for 2.7.

See #3706.

#21 @johnjamesjacoby
6 weeks ago

In 7908:

Tests: Cover user administration.

Test user admin hooks, role controls, bulk changes, row actions, columns, and role filtering.

In trunk, for 2.7.

See #3706.

#22 @johnjamesjacoby
6 weeks ago

In 7909:

Tests: Cover the main admin class.

Test admin hooks, notices, upgrade indicators, plugin links, assets, post states, capabilities, AJAX guards, and information screens.

In trunk, for 2.7.

See #3706.

#23 @johnjamesjacoby
6 weeks ago

In 7912:

Tests: Cover main admin menus and update screens.

Test menu visibility, settings registration, network activation, and updater screens.

In trunk, for 2.7.

See #3706.

#24 @johnjamesjacoby
6 weeks ago

In 7915:

Tests: Cover shared converter helpers.

Test converter database initialization, conversion-method delegation, and shared value callbacks.

In trunk, for 2.7.

See #3706.

#25 @johnjamesjacoby
6 weeks ago

In 7920:

Importers: Finish post-processing before success.

Track complete post-processing totals and deterministic row order so interrupted imports resume from the saved offset. Make repeated batches safe, preserve completed state across lost responses, and flush persistent caches once after final completion.

In trunk, for 2.7.

See #3706.
See #3729.
See #3730.

#26 @johnjamesjacoby
6 weeks ago

In 7928:

Tests: Cover common AJAX functions.

Add coverage for AJAX URL generation, request detection, action sanitization and dispatch, status handling, and process isolation. Update the PHPUnit installer for current MySQL and MariaDB, and make the anonymous-cookie helper compatible with the cli-server SAPI.

In trunk, for 2.7.

See #3706.

#27 @johnjamesjacoby
6 weeks ago

In 7929:

Tests: Cover locale and post-lock helpers.

Add direct coverage for role translations and catalog strings, and expand post-lock coverage across invalid inputs, ownership, persistence, replacement, legacy data, expiration, and filtered windows.

In trunk, for 2.7.

See #3706.

#28 @johnjamesjacoby
6 weeks ago

In 7930:

Tests: Cover common template foundations.

Add direct coverage for archive URL generation and escaping, extension hooks, site visibility across multisite, and forum, topic, and reply type predicates.

In trunk, for 2.7.

See #3706.

#29 @johnjamesjacoby
6 weeks ago

In 7931:

Tests: Cover common template query states.

Add direct coverage for query flags, query-name fallbacks, edit exclusions, user-home composition, and merge, split, and move states.

In trunk, for 2.7.

See #3706.

#30 @johnjamesjacoby
6 weeks ago

In 7932:

Tests: Cover tags, search, and shortcodes.

Add direct coverage for topic-tag and search conditionals, disabled feature handling, filter overrides, and shortcode detection.

In trunk, for 2.7.

See #3706.

#31 @johnjamesjacoby
5 weeks ago

In 7942:

Tests: Cover common template form helpers.

Add regression coverage for body-class filter context, bbPress request detection, login and redirect form URLs, request value sanitization, and tabindex attributes.

In trunk, for 2.7.

See #3706.

#32 @johnjamesjacoby
5 weeks ago

In 7943:

Tests: Cover dropdown and editor helpers.

Add regression coverage for dropdown rendering and disabled choices, fallback and WordPress editor output, editor hook cleanup, and TinyMCE and Quicktags configuration.

In trunk, for 2.7.

See #3706.

#33 @johnjamesjacoby
5 weeks ago

In 7949:

API: Normalize topic-view identifiers.

Convert integer view IDs to strings and reject other non-string values before filters and lookups. This prevents malformed query values from causing PHP errors and preserves registered numeric view links.

Update view-helper documentation and expand coverage for ID resolution, titles, URLs, filters, output escaping, and permalink modes.

In trunk, for 2.7.

See #3706.
See #3734.

#34 @johnjamesjacoby
5 weeks ago

In 7952:

Tests: Complete common template helper coverage.

Add direct coverage for tab indexes, the body-class script, allowed tags, notices, logout links, edit-form fields and nonce actions, breadcrumbs, title formatting, and protected and private title hints.

In trunk, for 2.7.

See #3706.

#35 @johnjamesjacoby
5 weeks ago

In 7954:

Tests: Cover common formatting helpers.

Add direct coverage for KSES sanitization, code encoding and reversal, link and mention callbacks, nonnegative counts, and UTF-8 display names.

In trunk, for 2.7.

See #3706.

#36 @johnjamesjacoby
5 weeks ago

In 7955:

Tests: Cover search pagination bases.

Add direct coverage for ugly and pretty permalink structures, singular shortcode pages, trailing-slash behavior, and the pagination-base filter.

In trunk, for 2.7.

See #3706.

#37 @johnjamesjacoby
5 weeks ago

In 7956:

Tests: Cover capability definitions.

Add direct coverage for forum, topic, reply, and topic-tag capability mappings, including filter input and array normalization.

In trunk, for 2.7.

See #3706.

#38 @johnjamesjacoby
5 weeks ago

In 7976:

Tests: Avoid legacy KSES script expectations.

WordPress 7.2's HTML API-backed KSES parser removes disallowed script elements together with their contents, while earlier versions preserve the contents as text. Use an ordinary disallowed element for exact sanitization and slashing assertions, and verify script markup separately so the test covers both supported behaviors.

In trunk, for 2.7.

See #3706.

#39 @johnjamesjacoby
5 weeks ago

In 7992:

Tests: Cover widget settings.

Add direct coverage for widget registration, option and settings filters, defaults, overrides, sanitized updates, and configuration forms.

In trunk, for 2.7.

See #3706.

#40 @johnjamesjacoby
5 weeks ago

In 7993:

Tests: Cover simple widget output.

Add direct coverage for logged-out Login widget links, Views early returns and output, Search availability and template dispatch, and Statistics template dispatch.

In trunk, for 2.7.

See #3706.

#41 @johnjamesjacoby
5 weeks ago

In 7994:

Tests: Cover query-backed widgets.

Add direct coverage for Forum parent queries, Topic ordering and optional output, and Reply ordering and output variants. Verify empty result handling and original query arguments.

In trunk, for 2.7.

See #3706.

#42 @johnjamesjacoby
5 weeks ago

In 7995:

Tests: Cover block registration.

Add direct coverage for registered metadata and shortcode mappings, hook setup, category filtering, render failures and callback forwarding, view data, and unknown localization keys. Correct malformed block coverage annotations.

In trunk, for 2.7.

See #3706.

#43 @johnjamesjacoby
5 weeks ago

In 7996:

Tests: Avoid deprecated reflection calls.

Call setAccessible() only on PHP versions that still require it. Reflection can access non-public members directly on PHP 8.1 and later, and PHP 8.5 deprecates the redundant call.

In trunk, for 2.7.

See #3706.

#44 @johnjamesjacoby
5 weeks ago

In 7997:

Tests: Avoid deprecated reflection calls.

Call setAccessible() only on PHP versions that still require it. Reflection can access non-public members directly on PHP 8.1 and later, and PHP 8.5 deprecates the redundant call.

In branches/2.6, for 2.6.20.

See #3706.

#45 @johnjamesjacoby
5 weeks ago

In 7998:

Tests: Improve environment compatibility.

Avoid the deprecated E_STRICT constant, use the supported storage engine setting on current MySQL and MariaDB versions, and declare test properties before assignment.

In branches/2.6, for 2.6.20.

See #3706.

#46 @johnjamesjacoby
5 weeks ago

In 7999:

Tests: Cover lifecycle action wrappers.

Add data-driven coverage for bbPress lifecycle hooks, argument forwarding, and the deprecated rewrite-rule wrapper. Isolate each hook from registered callbacks and restore its original state after every assertion.

In trunk, for 2.7.

See #3706.

#47 @johnjamesjacoby
5 weeks ago

In 8005:

Tests: Cover core action registrations.

Add data-driven coverage for every action in core/actions.php, including callbacks, priorities, and accepted argument counts. Guard the provider against source drift and name each data set for useful failures.

In trunk, for 2.7.

See #3706.

#48 @johnjamesjacoby
5 weeks ago

In 8006:

Tests: Group core hook assertions by behavior.

Replace exhaustive action registration coverage with focused assertions for meaningful action and filter contracts. Group related hooks by behavior and verify priorities and accepted arguments without mirroring the source files or tracking fluctuating registration counts.

In trunk, for 2.7.

See #3706.

#49 @johnjamesjacoby
5 weeks ago

In 8007:

Tests: Cover request action helpers.

Add direct coverage for POST and GET action sanitization, strict matching, request-method gating, malformed values, and global-state cleanup.

In trunk, for 2.7.

See #3706.

#50 @johnjamesjacoby
3 weeks ago

In 8169:

Tests: Cover forum capability helpers.

Add direct coverage for forum capability mapping across visibility, editing, frozen and inactive users, admin context, and filter contracts. Cover per-forum moderator checks and exclusion filtering.

In trunk, for 2.7.

See #3706.

#51 @johnjamesjacoby
3 weeks ago

In 8170:

Tests: Complete forum component coverage.

Add direct coverage for hidden reply count updates and routing, all-status subforum queries, row-action forwarding, and last-topic author links. Correct a malformed coverage annotation.

In trunk, for 2.7.

See #3706.

#52 @johnjamesjacoby
3 weeks ago

In 8173:

Tests: Complete reply component coverage.

Add direct coverage for the deprecated reply-count compatibility helper across published, spam, and effectively non-published replies.

In trunk, for 2.7.

See #3706.

#53 @johnjamesjacoby
3 weeks ago

In 8174:

Tests: Complete topic component coverage.

Add direct coverage for sticky-topic ordering, topic locks, toggle actions, legacy count routing, topic-tag retrieval, and taxonomy counts.

In trunk, for 2.7.

See #3706.

#54 @johnjamesjacoby
3 weeks ago

In 8175:

Tests: Complete core component coverage.

Add direct coverage for redirect behavior and site-wide moderator checks. Connect existing behavioral tests to the remaining Core functions, including options, forum status, statistics, theme compatibility, and legacy BuddyPress support.

In trunk, for 2.7.

See #3706.

#55 @johnjamesjacoby
3 weeks ago

In 8176:

Tests: Expand Common component coverage.

Add direct coverage for attachment parents, the REST attachment controller, the engagements interface, and XML-RPC date and capability helpers. Connect existing content-filter, user-discovery, and template-notice behavior tests to their covered functions.

In trunk, for 2.7.

See #3706.

#56 @johnjamesjacoby
3 weeks ago

In 8177:

Common: Preserve block editor decisions.

Keep the block editor disabled for bbPress post types without overriding the incoming decision for other post types. Add direct coverage for this behavior and for Common post-type, untrash, trash-retention, query, URL-scheme, and title-length helpers.

In trunk, for 2.7.

See #3706.
Fixes #3767.

#57 @johnjamesjacoby
3 weeks ago

In 8178:

Tests: Cover remaining Common helpers.

Add direct coverage for anonymous author data, strict moderation, nested notification suspension, email chunking, child-count filtering, and post-family cache priming.

In trunk, for 2.7.

See #3706.

#58 @johnjamesjacoby
3 weeks ago

In 8179:

Tests: Cover user engagement helpers.

Add direct coverage for relationship storage, engagement queries and updates, subscriber lookup, and topic subscription form handling.

In trunk, for 2.7.

See #3706.

#59 @johnjamesjacoby
3 weeks ago

In 8180:

Tests: Complete user template coverage.

Add direct coverage for user loops, fallback names, profile controls, request validation, engagement URLs, language selection, and moderator lists.

In trunk, for 2.7.

See #3706.

#60 @johnjamesjacoby
3 weeks ago

In 8181:

Tools: Report failed reset queries.

Treat false database-query returns as failures while preserving successful zero-row queries. Add regression coverage for skipped, successful, zero-row, and failed reset operations.

In trunk, for 2.7.

See #3706.
See #3768.

#61 @johnjamesjacoby
3 weeks ago

In 8183:

Tests: Complete admin tool helper coverage.

Add direct coverage for repair tool registration, page and run URLs, list controls, labels, metadata filters, status and overhead links, admin tabs, and tool navigation.

In trunk, for 2.7.

See #3706.

#62 @johnjamesjacoby
3 weeks ago

In 8184:

Tests: Cover remaining admin helpers.

Add direct coverage for admin icons, settings sanitization, converter capabilities, reply-move checks, repair cache and count behavior, engagements, and legacy usermeta removal.

In trunk, for 2.7.

See #3706.

#63 @johnjamesjacoby
3 weeks ago

In 8185:

Tests: Cover BuddyPress member helpers.

Add direct coverage for BuddyPress component and user filters, member screen and content callbacks, notification registration and marking, and Common AJAX headers.

In trunk, for 2.7.

See #3706.

#64 @johnjamesjacoby
3 weeks ago

In 8188:

Tests: Cover BuddyPress group relationships.

Add direct coverage for group and forum relationship getters, updates, additions, removals, filters, current-object fallbacks, and group-forum detection.

In trunk, for 2.7.

See #3706.

#65 @johnjamesjacoby
3 weeks ago

In 8189:

Tests: Cover BuddyPress group member states.

Add direct coverage for group administrator, moderator, member, banned, and creator helpers across logged-out, member-role, and outsider states.

In trunk, for 2.7.

See #3706.

#66 @johnjamesjacoby
3 weeks ago

In 8190:

Tests: Cover BuddyPress activity actions.

Add direct coverage for activity action labels, filters, invalid types, interception, and group topic and reply formatter resolution.

In trunk, for 2.7.

See #3706.

#67 @johnjamesjacoby
3 weeks ago

In 8191:

Tests: Cover BuddyPress forum root creation.

Add direct coverage for request, capability, and nonce validation, plus root forum creation, settings storage, forum type, title, and redirect behavior.

In trunk, for 2.7.

See #3706.

#68 @johnjamesjacoby
3 weeks ago

In 8192:

Tests: Cover BBCode lexer behavior.

Add direct coverage for structural tokens, comments, wiki and rule tags, quoted parameters, end tags, pushback, verbatim input, and tag markers.

In trunk, for 2.7.

See #3706.

#69 @johnjamesjacoby
3 weeks ago

In 8193:

Tests: Cover BBCode parser configuration.

Add direct coverage for scalar parser settings, rule collections and defaults, resource paths, smiley configuration, and smiley expression invalidation.

In trunk, for 2.7.

See #3706.

#70 @johnjamesjacoby
3 weeks ago

In 8196:

Tests: Cover BBCode parser helpers.

Add direct coverage for output encoding and normalization, template expansion and escaping, and email-validator component constraints.

In trunk, for 2.7.

See #3706.

#71 @johnjamesjacoby
3 weeks ago

In 8197:

Importers: Respect configured URL targets.

Use a strict comparison for the special override mode so ordinary targetable URLs continue to honor the configured target. Add direct coverage for BBCode renderer callbacks.

In trunk, for 2.7.

Fixes #3771.
See #3706.

#72 @johnjamesjacoby
3 weeks ago

In 8203:

Tests: Cover BBCode parser internals.

Add direct coverage for the legacy lexer constructor, smiley cache rebuilding, stack text and debug output, whitespace cleanup, and output limit state.

In trunk, for 2.7.

See #3706.

#73 @johnjamesjacoby
3 weeks ago

In 8204:

Tests: Cover BBCode tag state transitions.

Add direct coverage for tag mode dispatch, enhanced and plain output, missing end-tag markers, stack generation, class rewinding, rejected tags, whitespace cleanup, and start and end token processing.

In trunk, for 2.7.

See #3706.

#74 @johnjamesjacoby
3 weeks ago

In 8205:

Tests: Cover engagement handler redirects.

Add a reusable redirect interceptor and exercise successful favorite, topic subscription, and forum subscription additions and removals. Verify nonce variants, validated and default redirect targets, persistent engagement state, and request cleanup.

In trunk, for 2.7.

See #3706.

#75 @johnjamesjacoby
3 weeks ago

In 8206:

Tests: Cover topic tag management redirects.

Exercise successful topic tag renaming, merging, and deletion through their redirecting handler paths. Verify term changes, relationship transfer, redirect targets, denied edit redirects, and allowed edit access.

In trunk, for 2.7.

See #3706.

#76 @johnjamesjacoby
3 weeks ago

  • Owner set to johnjamesjacoby
  • Resolution → fixed
  • Status new → closed

In 8207:

Tests: Isolate shared PHPUnit state.

Restore mutable globals and options used by permission and BuddyPress integration tests so suites do not depend on execution order. Initialize the BuddyPress helper before asserting its global accessor.

In trunk, for 2.7.

Fixes #3706.

Note: See TracTickets for help on using tickets.