WordPress.org

Make WordPress Core

Opened 17 months ago

Closed 17 months ago

Last modified 17 months 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:

Description

Hi:

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 17 months ago.
Unit Tests of links_add_target
26164.diff (841 bytes) - added by mdbitz 17 months ago.
patch of links_add_target and _links_add_target

Download all attachments as: .zip

Change History (5)

@mdbitz17 months ago

Unit Tests of links_add_target

@mdbitz17 months ago

patch of links_add_target and _links_add_target

comment:1 @mdbitz17 months ago

  • Cc matt@… added

comment:2 @wonderboymusic17 months 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.

comment:3 @wonderboymusic17 months ago

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