Skip to content

Tests: Cover wptexturize_primes() - #15740

Closed
devmuhib009 wants to merge 2 commits into
WordPress:trunkfrom
devmuhib009:test/cover-wptexturize-primes
Closed

devmuhib009 wants to merge 2 commits into
WordPress:trunkfrom
devmuhib009:test/cover-wptexturize-primes

Conversation

@devmuhib009

@devmuhib009 devmuhib009 commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Description

Adds unit tests for the wptexturize_primes() function in src/wp-includes/formatting.php.

The tests cover:

  • Converting single quotes following numbers into single prime entities (′).
  • Converting double quotes following numbers into double prime entities (″).
  • Text containing no needle characters remaining unmodified.
  • Disambiguating quotes and primes within opened quotation marks.
  • Regular quotes not preceded by numbers being transformed into closing quotes.

Test-only change.

Testing Instructions

npm run test:php -- --filter Tests_Formatting_WptexturizePrimes
npm run test:php -- -c tests/phpunit/multisite.xml --filter Tests_Formatting_WptexturizePrimes
vendor/bin/phpcs tests/phpunit/tests/formatting/wptexturizePrimes.php

Trac ticket: https://core.trac.wordpress.org/ticket/66609

See #65819.
Props devmuhib009.
@github-actions

github-actions Bot commented Nov 6, 2026 •

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.

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

Props devmuhib, huzaifaalmesbah.

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@huzaifaalmesbah huzaifaalmesbah left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch, @devmuhib009! The coverage for primes and quote disambiguation is great.

Per #65819 comment 1521, all new test-only additions now need their own Trac ticket filed under the specific component rather than referencing the umbrella ticket #65819.

For wptexturize_primes() in src/wp-includes/formatting.php, the component is Formatting.

Could you please:

  1. Open a dedicated Trac ticket under the Formatting component with the has-patch and has-unit-tests keywords and link this PR.
  2. Update the Trac ticket: URL in this PR's description.
  3. Update the @ticket 65819 annotations in wptexturizePrimes.php with the new ticket ID.

AI Review: Gemini 3.8 Flash

See #66609.
Props devmuhib009.
@devmuhib009

Copy link
Copy Markdown
Member Author

Thanks for the review! Dedicated Trac ticket #66609 has been created under the Formatting component with has-patch, has-unit-tests.

The PR description and the test class @ticket annotations have now been updated to reference #66609.

wporg-sync pushed a commit that referenced this pull request Nov 27, 2026
Verify:
- Replacing single quotes with single prime entities (`&#8242;`) following numbers.
- Replacing double quotes with double prime entities (`&#8243;`) following numbers.
- Ensuring strings without target quotes remain unmodified.
- Disambiguating quotes and primes within opened quotation marks.
- Ensuring regular quotes not preceded by numbers become closing quotes.

Developed in #15740.

Props devmuhib, huzaifaalmesbah.
Fixes #66609.

git-svn-id: https://develop.svn.wordpress.org/trunk@65809 602fd350-edb4-49c9-b593-d223f7449a82
@github-actions

Copy link
Copy Markdown

A commit was made that fixes the Trac ticket referenced in the description of this pull request.

SVN changeset: 65809
GitHub commit: 174722c

This PR will be closed, but please confirm the accuracy of this and reopen if there is more work to be done.

@github-actions github-actions Bot closed this Nov 27, 2026
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Nov 27, 2026
Verify:
- Replacing single quotes with single prime entities (`&#8242;`) following numbers.
- Replacing double quotes with double prime entities (`&#8243;`) following numbers.
- Ensuring strings without target quotes remain unmodified.
- Disambiguating quotes and primes within opened quotation marks.
- Ensuring regular quotes not preceded by numbers become closing quotes.

Developed in WordPress/wordpress-develop#15740.

Props devmuhib, huzaifaalmesbah.
Fixes #66609.
Built from https://develop.svn.wordpress.org/trunk@65809


git-svn-id: http://core.svn.wordpress.org/trunk@64838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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.

2 participants