Make WordPress Core

Opened 9 years ago

Closed 11 days ago

Last modified 11 days ago

#42058 closed defect (bug) (fixed)

Unit test for _autop_newline_preservation_helper()

Reported by: pbearne Owned by: lancewillett
Priority: normal Milestone: 7.2
Component: Formatting Version: 4.9
Severity: normal Keywords: has-patch has-unit-tests
Cc: Focuses: tests

Description

just a unit test

Attachments (1)

Autop-Newline-Preservation-Helper.php.patch​ (1.3 KB ) - added by pbearne 9 years ago.
Unit test

Download all attachments as: .zip

Change History (8)

#1 @pbearne
9 years ago

  • Keywords has-patch has-unit-tests dev-feedback added

#2 @desrosj
5 months ago

  • Focuses tests added

Adding the tests focus, which is used to indicate a ticket is solely focused on adding tests.

This ticket was mentioned in ​PR #13715 on ​WordPress/wordpress-develop by ​@mindctrl.


2 weeks ago
#3

Added phpunit coverage for _autop_newline_preservation_helper().

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

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Opus 5
Used for: Reviewing original patch on Trac and generating the tests in this PR. Cross reviewed with GPT 5.6 Sol.

#4 @mindctrl
2 weeks ago

  • Keywords dev-feedback removed

@pbearne I created a PR for this at ​https://github.com/WordPress/wordpress-develop/pull/13715. Can you take a look when you have time?

#5 @lancewillett
11 days ago

  • Milestone Awaiting Review → 7.2
  • Owner set to lancewillett
  • Status new → accepted

#6 @lancewillett
11 days ago

  • Resolution → fixed
  • Status accepted → closed

In 64008:

Tests: Cover newline preservation in wpautop().

Add coverage for _autop_newline_preservation_helper(), including newline replacement, unchanged content, carriage returns, and ignored capture groups. Exercise the helper as a callback with script, style, SVG, and MathML elements.

Only 9 years after the original patch, this coverage is still valuable!

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13715

Props pbearne, mindctrl.
Fixes #42058.

​@lancewillett commented on ​PR #13715:


11 days ago
#7

Only 9 years later! Thanks for your patience @pbearne

Note: See TracTickets for help on using tickets.