Skip to:
Content

bbPress.org

Opened 9 days ago

Closed 4 days ago

#3695 closed task (blessed) (fixed)

Complete incomplete PHPUnit coverage for 2.7

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

At trunk r7759, the main and multisite PHPUnit suites pass, but each reports 342 incomplete tests. The active markTestIncomplete() placeholders span 45 test files. This coverage work is separate from the failures tracked in #3657 (closed).

Goal: replace the incomplete placeholders with meaningful assertions for supported behavior, and add missing regression cases found during the audit. Prioritize permissions and visibility, mutations and counts, and integrations. Do not turn placeholders into empty passing tests.

Work one test file or component at a time in small, reviewable changes. For each batch:

  • Confirm the covered behavior and whether each placeholder still applies.
  • Add fixtures, positive and negative cases, and relevant edge cases. Explain any obsolete test removed.
  • Run the focused tests, then the main and multisite suites, plus BuddyPress where relevant, PHP lint, PHPCS, and applicable CI.
  • Record the incomplete-test count before and after, and link the canonical Subversion revision here.
  • Track any product defect discovered during testing separately where practical; do not change expectations merely to obtain green CI.

Completion means every baseline placeholder has been implemented or explicitly dispositioned, remaining skips/incompletes have a documented reason and follow-up, assertion-free tests and other high-risk gaps have been reviewed, and the applicable test matrix passes. The count may grow or shrink as coverage is added.

Change History (55)

#1 @johnjamesjacoby
9 days ago

In 7761:

Tests: Cover core abstraction contracts.

Replace six incomplete helper tests and add coverage for pagination, site switching, interception, setup reuse, and date and version behavior.

In trunk, for 2.7.
See #3695.

#2 @johnjamesjacoby
8 days ago

In 7762:

Tests: Expand common, search, user, and admin coverage.

Replace 58 incomplete placeholders with assertions for common helpers, search requests, user templates, and safe admin-tool paths. Add search-type and request-sanitization coverage, with fixtures restored after each test.

In trunk, for 2.7.
See #3695.

#3 @johnjamesjacoby
7 days ago

In 7764:

Tests: Cover user option behavior.

Replace seven incomplete user-option tests with assertions for defaults, option updates and deletion, filter setup and overrides, last-posted values, and multisite isolation. Restore hook and global state after each test.

In trunk, for 2.7.
See #3695.

#4 @johnjamesjacoby
7 days ago

In 7767:

Tests: Cover reply status helpers.

Replace the incomplete reply-status test and cover default status labels, toggle actions, public and non-public status lists, and their filter extension points.

In trunk, for 2.7.
See #3695.

#5 @johnjamesjacoby
6 days ago

In 7768:

Forums: Preserve category status mismatches.

Combine each category ancestor's status with the preceding result so a matching outer category cannot erase an intermediate mismatch. Complete the forum status helper coverage and add a nested-category regression test.

In trunk, for 2.7.
See #3696.
See #3695.

#6 @johnjamesjacoby
6 days ago

In 7770:

Tests: Cover forum last-reply and post-type helpers.

Replace five incomplete tests with coverage of reply permalink and URL behavior, topic-ID and missing-metadata fallbacks, forum post-type defaults and filter hooks. Correct the forum post-type output assertion.

In trunk, for 2.7.
See #3695.

#7 @johnjamesjacoby
6 days ago

In 7771:

Tests: Cover forum loop behavior.

Replace three incomplete forum-loop tests with coverage for root and child queries, empty and searched results, filter arguments, and iteration cleanup. Restore query and request state after each test.

In trunk, for 2.7.
See #3695.

#8 @johnjamesjacoby
6 days ago

In 7772:

Forums: Correct form moderator and dropdown values.

Restore assigned moderator nicenames in forum edit forms, explicitly select the forum type for new forums, and add a visibility dropdown filter. Preserve the existing type dropdown filter call for compatibility. Complete the forum-form template tests and add regressions for these defects.

In trunk, for 2.7.

See #3697.
See #3695.

#9 @johnjamesjacoby
5 days ago

In 7774:

Tests: Cover forum status and type helpers.

Replace incomplete tests with assertions for forum status and type values, filters, actions, and metadata transitions. Cover the public and non-public forum post-status helpers.

In trunk, for 2.7.

See #3695.

#10 @johnjamesjacoby
5 days ago

In 7775:

Tests: Cover forum template helpers and counts.

Replace eight incomplete forum template tests with coverage for lookup, archive titles, hierarchy, listings, links, and classes. Add hidden-reply-count coverage and exercise category listings and subscription states.

In trunk, for 2.7.

See #3695.

#11 @johnjamesjacoby
5 days ago

In 7776:

Tests: Cover forum lifecycle helpers.

Replace nine incomplete tests with coverage for forum topic trash and restore, subscription cleanup, and lifecycle actions. Verify that restoring a forum leaves previously trashed topics alone.

In trunk, for 2.7.

See #3695.

#12 @johnjamesjacoby
5 days ago

In 7777:

Tests: Cover forum submission and visibility.

Replace seven incomplete forum-function tests with cases for create/edit submissions, attribute saves, edit permissions, exclusion formats, and direct-URL visibility. Include invalid-nonce regressions for both submission handlers.

In trunk, for 2.7.

See #3695.

#13 @johnjamesjacoby
5 days ago

In 7778:

Tests: Cover topic and reply status templates.

Replace fifteen incomplete status-template tests with assertions for sticky, public, moderation, and anonymous behavior. Add coverage for the public-status helpers missing from the original stubs.

In trunk, for 2.7.

See #3695.

#14 @johnjamesjacoby
5 days ago

In 7779:

Tests: Cover topic status functions.

Replace ten incomplete tests for topic statuses, stickies, and moderation transitions. Add checks for toggle and visibility lists, plus restoration of a pending topic after reopening.

In trunk, for 2.7.

See #3695.

#15 @johnjamesjacoby
5 days ago

In 7780:

Tests: Cover topic and reply template loops.

Replace twelve incomplete tests for topic and reply query loops and post-type settings. Verify populated and empty loops, current-post advancement, labels, rewrite settings, and supported features.

In trunk, for 2.7.

See #3695.

#16 @johnjamesjacoby
5 days ago

In 7781:

Tests: Cover topic and reply author templates.

Replace twelve incomplete author-template tests. Verify registered and anonymous names, avatars, links, URLs, email addresses, and displayed roles, including output wrappers.

In trunk, for 2.7.

See #3695.

#17 @johnjamesjacoby
5 days ago

In 7782:

Tests: Cover topic and reply revision templates.

Replace ten incomplete tests with real revision fixtures. Verify raw and formatted logs, output wrappers, appended content, revision retrieval, and formatted versus integer counts.

In trunk, for 2.7.

See #3695.

#18 @johnjamesjacoby
5 days ago

In 7783:

Tests: Cover general topic template helpers.

Replace ten incomplete tests for topic lookup, archive titles, pagination, CSS classes, notices, selectors, descriptions, and row-action hooks. Keep notice assertions isolated from the shared error queue.

In trunk, for 2.7.

See #3695.

#19 @johnjamesjacoby
5 days ago

In 7784:

Tests: Cover remaining reply template helpers.

Replace three incomplete tests for reply lookup, CSS classes, and topic pagination counts. Check object and array lookup shapes and the corresponding output wrappers.

In trunk, for 2.7.

See #3695.

#20 @johnjamesjacoby
5 days ago

In 7785:

Tests: Cover search template helpers.

Replace nine incomplete tests for search queries, loop advancement, titles, URLs, terms, and pagination output. Exercise populated and empty search results with stable fixtures.

In trunk, for 2.7.

See #3695.

#21 @johnjamesjacoby
5 days ago

In 7786:

Tests: Cover topic and reply form templates.

Replace 17 incomplete stubs with checks for form defaults, submitted and edit values, dropdown output, and nonce validation.

In trunk, for 2.7.

See #3695.

#22 @johnjamesjacoby
5 days ago

In 7787:

Tests: Cover parent queries and anonymous counts.

Replace two incomplete stubs with checks for parent include and exclude filters, WordPress-native behavior, and anonymous topic and reply counts.

In trunk, for 2.7.

See #3695.

#23 @johnjamesjacoby
5 days ago

In 7788:

Tests: Cover engagement handler rejection paths.

Replace three incomplete stubs with checks for missing objects, unsupported actions, invalid nonces, and unchanged engagement state. Record the redirecting success path for integration coverage.

In trunk, for 2.7.

See #3695.

#24 @johnjamesjacoby
5 days ago

In 7789:

Tests: Cover core update lifecycle helpers.

Replace eight incomplete stubs with checks for install and update detection, plugin activation state, version bumps, activation redirects, and keymaster promotion.

In trunk, for 2.7.

See #3695.

#25 @johnjamesjacoby
5 days ago

In 7790:

Tests: Cover topic tag function behavior.

Replace five incomplete stubs with checks for tag preservation, restoration, names, and rejected management requests. Record redirecting paths for integration coverage.

In trunk, for 2.7.

See #3695.

#26 @johnjamesjacoby
5 days ago

In 7791:

Tests: Cover topic tag template basics.

Replace seven incomplete stubs with checks for tag lists, taxonomy metadata, explicit tag lookup, and links. Leave edit-link and description behavior for a separately reviewed source fix.

In trunk, for 2.7.

See #3695.

#27 @johnjamesjacoby
5 days ago

In 7792:

Tests: Cover topic template links.

Replace fourteen incomplete stubs with checks for engagement, reply, moderation, edit, and pagination links across their relevant topic states.

In trunk, for 2.7.

See #3695.

#28 @johnjamesjacoby
5 days ago

In 7793:

Tests: Cover reply action links and pagination.

Replace the remaining reply-link template stubs with assertions for action URLs, custom text, moderation status transitions, threaded reply cancellation, pagination, and output wrappers.

In trunk, for 2.7.

See #3695.

#29 @johnjamesjacoby
5 days ago

In 7794:

Tests: Cover user request and anonymous helpers.

Replace six user-function stubs with assertions for login redirect selection, anonymous posting eligibility, commenter cookie reads and output escaping, IP sanitization, and user-agent length limits.

In trunk, for 2.7.

See #3695.

#30 @johnjamesjacoby
5 days ago

In 7795:

Tests: Cover four admin repair routines.

Replace repair stubs with assertions for stale sticky relationships, closed-topic metadata, topic-parent metadata, and self-referential reply ancestry.

In trunk, for 2.7.

See #3695.

#31 @johnjamesjacoby
5 days ago

In 7796:

Tests: Cover user relationship repair routines.

Verify that favorite, topic subscription, and forum subscription repairs retain published objects while removing trashed objects from stored user relationships.

In trunk, for 2.7.

See #3695.

#32 @johnjamesjacoby
5 days ago

In 7797:

Tests: Cover role, freshness, and visibility repairs.

Verify that admin repair routines remap forum roles, rebuild topic and forum freshness metadata, and recalculate private and hidden forum lists.

In trunk, for 2.7.

See #3695.

#33 @johnjamesjacoby
5 days ago

In 7798:

Tests: Cover the admin reset page and guards.

Initialize the bbPress admin test dependency so this file runs independently, then replace stale reset stubs with page-rendering and non-resetting request assertions.

In trunk, for 2.7.

See #3695.

#34 @johnjamesjacoby
5 days ago

In 7799:

Tests: Cover private group forum upgrades.

Remove a stub for the retired group-forum repair function and verify that its upgrade replacement remaps a legacy forum ID and hides a private group's forum.

In trunk, for 2.7.

See #3695.

#35 @johnjamesjacoby
5 days ago

In 7800:

Tests: Cover topic metadata and option helpers.

Replace ten topic-function stubs with assertions for status and type choices, sticky lists, user relationship cleanup, topic IDs, pagination options, and autoembed hooks.

In trunk, for 2.7.

See #3695.

#36 @johnjamesjacoby
5 days ago

In 7801:

Tests: Cover topic lifecycle hooks and metadata.

Replace seven topic-function stubs with assertions for revision logs, delete and trash action dispatch, and selective reply trashing.

In trunk, for 2.7.

See #3695.

#37 @johnjamesjacoby
5 days ago

In 7802:

Tests: Cover topic update metadata paths.

Verify edit lock cleanup and forum/topic identifiers on edits, plus last activity and reply-count metadata on new-topic updates.

In trunk, for 2.7.

See #3695.

#38 @johnjamesjacoby
5 days ago

In 7803:

Tests: Cover reply metadata and lifecycle helpers.

Replace thirteen reply-function stubs with assertions for update metadata, revision logs, lifecycle hooks, pagination options, autoembed setup, lead-topic SQL, and raw positions.

In trunk, for 2.7.

See #3695.

#39 @johnjamesjacoby
5 days ago

In 7804:

Tests: Cover threaded reply list output.

Verify supported and fallback wrappers, pagination state, and reply-loop cleanup using a controlled walker.

In trunk, for 2.7.

See #3695.

#40 @johnjamesjacoby
5 days ago

In 7805:

Tests: Cover user notification, profile hooks, and blocking.

Replace three user-function stubs with assertions for email-change notices, profile action routing, and blocked-user 404 enforcement. Keep request handlers for separate integration coverage.

In trunk, for 2.7.

See #3695.

#41 @johnjamesjacoby
5 days ago

In 7806:

Tests: Cover user profile edit permissions.

Replace the user-edit authorization stub with assertions for non-edit pages, denied users, self-editing, administrators, and the edit-any override. Inspect redirect decisions without exiting the PHPUnit process.

In trunk, for 2.7.

See #3695.

#42 @johnjamesjacoby
4 days ago

In 7807:

Replies: Correct ancestry and position comparisons.

Stop threaded reply ancestry at the root instead of appending a zero ID, and compare normalized integer positions so unchanged replies do not trigger redundant writes. Add regression coverage for both cases.

In trunk, for 2.7.

See #3698.
See #3699.
See #3695.

#43 @johnjamesjacoby
4 days ago

In 7809:

Topic Tags: Respect explicit tags in edit links and descriptions.

Pass the resolved tag to edit-link generation for both permalink styles, and initialize the explicit tag before passing it to description filters. Add regression coverage for missing tags, output, permalink styles, and filter context.

In trunk, for 2.7.

See #3700.
See #3701.
See #3695.

#44 @johnjamesjacoby
4 days ago

In 7811:

Tests: Cover topic submission and edit handlers.

Replace incomplete stubs with checks for topic creation, editing, permission denials, moderation toggles, and edit redirects. Remove merge and split placeholders already covered by dedicated permission tests.

In trunk, for 2.7.

See #3695.

#45 @johnjamesjacoby
4 days ago

In 7812:

Tests: Cover reply toggle and edit permissions.

Check missing and unauthorized reply toggles, successful approval and redirect, and reply edit access. Remove redundant new, edit, and move handler placeholders already covered by permission tests.

In trunk, for 2.7.

See #3695.

#46 @johnjamesjacoby
4 days ago

In 7815:

Tests: Cover reply toggle and threading.

Exercise spam and trash round trips, redirect and filter arguments, and threaded reply settings and profile behavior.

In trunk, for 2.7.

See #3695.

#47 @johnjamesjacoby
4 days ago

In 7816:

Topics/Replies: Document unused count helpers.

Mark the insert count update helpers as deprecated in documentation. They remain callable for extensions, while count updates continue through post-status transitions.

In trunk, for 2.7.

See #3695.

#48 @johnjamesjacoby
4 days ago

In 7817:

Topics/Replies: Document unused count helpers.

Mark the insert count update helpers as deprecated in documentation. They remain callable for extensions, while count updates continue through post-status transitions.

In branches/2.6, for 2.6.20.

See #3695.

#49 @johnjamesjacoby
4 days ago

In 7818:

Tests: Cover user profile rejection paths.

Verify anonymous cookie input guards, user edit nonce and email validation, and email confirmation rejection. Keep successful cookie headers marked for an HTTP test harness.

In trunk, for 2.7.

See #3695.

#50 @johnjamesjacoby
4 days ago

In 7819:

Tests: Cover topic and reply RSS feeds.

Run feed renderers in isolated PHP subprocesses so their exits do not terminate PHPUnit. Assert RSS structure, public items, protected topic redaction, and private-topic reply exclusion.

In trunk, for 2.7.

See #3695.

#51 @johnjamesjacoby
4 days ago

In 7820:

Tests: Cover anonymous author cookies.

Use a one-request loopback PHP server to inspect the Set-Cookie headers emitted by the anonymous author helper. Verify name, email, and website values without changing runtime behavior.

In trunk, for 2.7.

See #3695.

#52 @johnjamesjacoby
4 days ago

In 7821:

Tests: Cover user nicename and author-change helpers.

Exercise nicename lookup and ID conversion, including input sanitization and filters. Assert that changing topic and reply authors recalculates engagement membership, and identify existing profile-permission coverage.

In trunk, for 2.7.

See #3695.

#53 @johnjamesjacoby
4 days ago

In 7822:

Tests: Cover user signup and invitation roles.

Exercise role-field permissions, signup validation, invitation metadata, and activation role assignment on single-site and multisite installs.

In trunk, for 2.7.

See #3695.

#54 @johnjamesjacoby
4 days ago

In 7825:

Tests: Cover user roles and moderator helpers.

Exercise forum-role assignment, activity and profile visibility, and moderator relationships. Identify existing profile-permission coverage.

In trunk, for 2.7.

See #3695.

#55 @johnjamesjacoby
4 days ago

  • Resolution → fixed
  • Status assigned → closed

In 7826:

Tests: Complete skipped-test audit.

Run URL assertions on multisite, where they now pass, and correct BuddyPress group test fixtures so nonce and capability paths execute in the intended request context. Document the remaining dynamic group activity limitation.

In trunk, for 2.7.

See #3705.
Fixes #3695.

Note: See TracTickets for help on using tickets.