Make WordPress Core

Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#26164 closed defect (bug) (fixed)

Unit Tests :: links_add_target function and trivial changes

Reported by: mdbitz Owned by: wonderboymusic
Milestone: 3.8 Priority: normal
Severity: normal Version:
Component: Unit Tests Keywords: has-patch
Focuses: Cc:



Attached are some Unit Tests of the formatting function links_add_target. Upon implementation of the tests I found 2 trivial changes with fixes in the included diff. Please let me know if correcting these items is desired or if I should update the test cases to sync with current functionality.

  • Replacing existing target="" properties add additional space character
  • tags without properties (e.g. <a>) don't get appended with target property

Thank you

Attachments (2)

LinksAddTarget.php (3.4 KB) - added by mdbitz 2 years ago.
Unit Tests of links_add_target
26164.diff (841 bytes) - added by mdbitz 2 years ago.
patch of links_add_target and _links_add_target

Download all attachments as: .zip

Change History (5)

2 years ago

Unit Tests of links_add_target

2 years ago

patch of links_add_target and _links_add_target

#1 @mdbitz
2 years ago

  • Cc matt@… added

#2 @wonderboymusic
2 years ago

  • Owner set to wonderboymusic
  • Resolution set to fixed
  • Status changed from new to closed

In 26328:

Add unit tests for links_add_target(). Alter the patterns in links_add_target() and _links_add_target() slightly based on learnings after running tests.

Props mdbitz.
Fixes #26164.

#3 @wonderboymusic
2 years ago

  • Milestone changed from Awaiting Review to 3.8
Note: See TracTickets for help on using tickets.