You are here

function LocalePluralFormatTest::assertPluralFormat in Drupal 7

Helper assert to test locale_get_plural page.

Parameters

$count: Number for testing.

$lang: Language for testing

$expected_result: Expected result.

$message:

1 call to LocalePluralFormatTest::assertPluralFormat()
LocalePluralFormatTest::testGetPluralFormat in modules/locale/locale.test
Tests locale_get_plural() functionality.

File

modules/locale/locale.test, line 798
Tests for locale.module.

Class

LocalePluralFormatTest
Tests plural index computation functionality.

Code

function assertPluralFormat($count, $lang, $expected_result) {
  $message_param = array(
    '@lang' => $lang,
    '@count' => $count,
    '@expected_result' => $expected_result,
  );
  $message = t("Computed plural index for '@lang' with count @count is @expected_result.", $message_param);
  $message_param = array(
    '@lang' => $lang,
    '@expected_result' => $expected_result,
  );
  $this
    ->assertText(format_string('Language: @lang, locale_get_plural: @expected_result.', $message_param, $message));
}