function _locale_test_plural_format_tests
Helper function with list of test cases
Return value
array
2 calls to _locale_test_plural_format_tests()
- LocalePluralFormatTest::testGetPluralFormat in modules/
locale/ locale.test - Tests locale_get_plural() functionality.
- locale_test_plural_format_page in modules/
locale/ tests/ locale_test.module - Returns markup for locale_get_plural testing.
File
-
modules/
locale/ tests/ locale_test.module, line 162
Code
function _locale_test_plural_format_tests() {
return array(
// Test data for English (no formula present).
array(
'count' => 1,
'language' => 'en',
'expected-result' => 0,
),
array(
'count' => 0,
'language' => 'en',
'expected-result' => 1,
),
array(
'count' => 5,
'language' => 'en',
'expected-result' => 1,
),
// Test data for French (simpler formula).
array(
'count' => 1,
'language' => 'fr',
'expected-result' => 0,
),
array(
'count' => 0,
'language' => 'fr',
'expected-result' => 1,
),
array(
'count' => 5,
'language' => 'fr',
'expected-result' => 1,
),
// Test data for Croatian (more complex formula).
array(
'count' => 1,
'language' => 'hr',
'expected-result' => 0,
),
array(
'count' => 21,
'language' => 'hr',
'expected-result' => 0,
),
array(
'count' => 0,
'language' => 'hr',
'expected-result' => 2,
),
array(
'count' => 2,
'language' => 'hr',
'expected-result' => 1,
),
array(
'count' => 8,
'language' => 'hr',
'expected-result' => 2,
),
// Test data for Hungarian (nonexistent language).
array(
'count' => 1,
'language' => 'hu',
'expected-result' => -1,
),
array(
'count' => 21,
'language' => 'hu',
'expected-result' => -1,
),
array(
'count' => 0,
'language' => 'hu',
'expected-result' => -1,
),
);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.