Skip to content

test: create username collisions through customer helper - #1851

Merged
superdav42 merged 1 commit into
mainfrom
feature/auto-20260910-082507-gh1848
Sep 10, 2026
Merged

test: create username collisions through customer helper#1851
superdav42 merged 1 commit into
mainfrom
feature/auto-20260910-082507-gh1848

Conversation

@superdav42

@superdav42 superdav42 commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replace the direct WordPress user factory collision setup with wu_create_customer().
  • Preserve the normalized username collision behavior and assertion.

Testing

  • vendor/bin/phpcs tests/WP_Ultimo/Functions/Customer_Functions_Test.php
  • vendor/bin/phpunit --filter Customer_Functions_Test

Resolves #1848


aidevops.sh v3.32.317 plugin for OpenCode v1.18.30 with gpt-5.6-terra

Summary by CodeRabbit

  • Tests
    • Updated customer username collision coverage to create customers through the supported customer workflow.
    • Added validation that customer creation succeeds before checking the resulting user ID.

@superdav42 superdav42 added the origin:worker Auto-created by pulse labelless backfill (t2112) label Sep 10, 2026
@superdav42

Copy link
Copy Markdown
Collaborator Author

Merge summary

Replaced the direct WordPress user factory collision setup with wu_create_customer() while preserving the normalized username collision assertion.

Verification

  • vendor/bin/phpcs tests/WP_Ultimo/Functions/Customer_Functions_Test.php
  • vendor/bin/phpunit --filter Customer_Functions_Test

aidevops.sh v3.32.317 plugin for OpenCode v1.18.30 with gpt-5.6-terra spent 6m and 72,360 tokens on this as a headless worker.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 755bb7f1-4ba1-46d2-abec-fd266f218376

📥 Commits

Reviewing files that changed from the base of the PR and between 0309042 and 445b519.

📒 Files selected for processing (1)
  • tests/WP_Ultimo/Functions/Customer_Functions_Test.php

Included review availability: Your plan provides up to 2 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The collision test now creates the conflicting account with wu_create_customer, verifies successful creation, and obtains the WordPress user ID from the resulting customer.

Changes

Customer collision test

Layer / File(s) Summary
Use customer helper for collision setup
tests/WP_Ultimo/Functions/Customer_Functions_Test.php
The test creates the colliding account with wu_create_customer, asserts that creation succeeds, and reads the user ID from the customer object.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 445b5

The collision test now creates its conflicting account through the customer helper while preserving the existing behavior. No current merge-blocking risk is evident.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: using the customer helper to create username-collision test data.
Linked Issues check ✅ Passed The change satisfies issue #1848 by replacing direct WordPress factory setup with wu_create_customer() while preserving the collision login value and test behavior.
Out of Scope Changes check ✅ Passed The pull request changes only the targeted collision test setup and contains no unrelated code changes.
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/auto-20260910-082507-gh1848

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

@superdav42
superdav42 merged commit 6a5dd88 into main Sep 10, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

origin:worker Auto-created by pulse labelless backfill (t2112)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Review followup: PR #1830 — fix: normalize spaces in generated usernames

1 participant