Skip to content

Plugin Directory: Add unit tests for Email\Base::plugin_title()#608

Open
dd32 wants to merge 2 commits intoWordPress:trunkfrom
dd32:add/claude/email-plugin-title-tests
Open

Plugin Directory: Add unit tests for Email\Base::plugin_title()#608
dd32 wants to merge 2 commits intoWordPress:trunkfrom
dd32:add/claude/email-plugin-title-tests

Conversation

@dd32
Copy link
Copy Markdown
Member

@dd32 dd32 commented Apr 16, 2026

Adds unit tests for the plugin_title() helper method introduced in #606.

Summary

  • 14 test cases covering realistic entity scenarios observed in the plugin directory database
  • Uses reflection to bypass the Base constructor (which requires DB access)
  • Uses an anonymous subclass to expose the protected method

Test coverage

Based on real plugin titles found in the DB:

  • Registered trademark (®), trademark (™), copyright (©), degree (°)
  • Accented characters (ç, ã, é, etc.)
  • Numeric entities (★ stars)
  • Hex numeric entities (🏦 building emoji)
  • HTML5-only entities (')
  • Non-breaking space ( )
  • Already-decoded UTF-8 characters (unchanged pass-through)
  • Empty string, plain text, quote entities

Test plan

  • Verify all tests pass in CI (WP: Plugin Directory job)

🤖 Generated with Claude Code

Covers the entity decoding scenarios added in WordPress#606, based on real
plugin titles observed in the database (®, ™, ©,
numeric entities, hex entities, HTML5-only ', etc).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props dd32.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Avoids needing a subclass (which PHPCS flags via the "one object
per file" rule) and avoids invoking the Base constructor which
requires a real plugin loaded from the DB.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant