Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#35284 closed enhancement (fixed)

Unit tests for wp_get_pomo_file_data()

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

Description

I wrote an unit test for wp_get_pomo_file_data(). I needed also some header information in one of the po-files so I decided to modify the simple.po file too.

Attachments (4)

35284.patch​ (2.8 KB ) - added by realloc 11 years ago.
Tests for wp_get_pomo_file_data and modified simple.po
35284.2.patch​ (2.1 KB ) - added by ocean90 11 years ago.
languages.zip​ (711.9 KB ) - added by ocean90 11 years ago.
35284.3.patch​ (1.2 KB ) - added by realloc 11 years ago.
Refreshed tests for wp_get_pomo_file_data()

Download all attachments as: .zip

Change History (11)

@realloc
11 years ago

Tests for wp_get_pomo_file_data and modified simple.po

#1 @swissspidy
11 years ago

  • Keywords has-unit-tests added

#2 @ocean90
11 years ago

  • Milestone Awaiting Review → 4.5
  • Owner set to ocean90
  • Status new → reviewing
  • Version trunk

#3 @ocean90
11 years ago

Attached 35284.2.patch​ and languages.zip​.

The language files (Spanish and British English) need to be copied to tests/phpunit/data/languages. The total size of them is ~2.7 MB and the test takes also > 650ms..

@swissspidy I remember that you've linked this ticket in another one, do you know which ticket it was?

#4 follow-up: @swissspidy
11 years ago

@ocean90 Perhaps you mean #34114 where I mentioned defining the constant like in your patch?
Otherwise I'll search again tomorrow.

#5 in reply to: ↑ 4 @ocean90
11 years ago

Replying to swissspidy:

@ocean90 Perhaps you mean #34114

Yep, thanks!

#6 @ocean90
11 years ago

  • Resolution → fixed
  • Status reviewing → closed

In 36563:

Tests: Add test for wp_get_installed_translations().

Introduces language files in /tests/phpunit/data/language. Each file includes the header and 5 translations.

Props realloc for initial patch.
Fixes #35284.

@realloc
11 years ago

Refreshed tests for wp_get_pomo_file_data()

#7 @ocean90
11 years ago

In 36710:

L10n: Add test for wp_get_pomo_file_data().

Props realloc.
See #35284.

Note: See TracTickets for help on using tickets.