WordPress.org

Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#36029 closed task (blessed) (fixed)

Unit tests for number_format_i18n()

Reported by: swissspidy Owned by: swissspidy
Milestone: 4.5 Priority: normal
Severity: normal Version: 2.3
Component: I18N Keywords: has-unit-tests
Focuses: Cc:

Description

This is a follow-up to #35840 for specifically adding unit tests for number_format_i18n().

There's a rough patch I'll work on getting commit-ready.

Attachments (2)

36029.diff (1.7 KB) - added by swissspidy 4 years ago.
36029.2.diff (1.9 KB) - added by swissspidy 4 years ago.
Only clone WP_Locale object when necessary

Download all attachments as: .zip

Change History (6)

#1 @swissspidy
4 years ago

  • Owner set to swissspidy
  • Status changed from new to accepted

@swissspidy
4 years ago

#2 @swissspidy
4 years ago

  • Keywords has-unit-tests added; needs-unit-tests removed

@swissspidy
4 years ago

Only clone WP_Locale object when necessary

#3 @swissspidy
4 years ago

For clarification, with 36029.2.diff I took the tests from #35840 and:

  • Fixed the inline docs and naming of the functions
  • Removed all tests and assertions for using non-numerical values
  • Reduced the number of duplicate assertions
  • Properly clean up $wp_locale after usage (and before assertion is run!)
  • Added a new test for when a negative precision is used

#4 @swissspidy
4 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 36795:

Tests: Add unit tests for number_format_i18n().

Props pbearne for initial patch.
Fixes #36029.

Note: See TracTickets for help on using tickets.