You are here

private function PotxTestCase::assertPluralIDContext in Translation template extractor 7.2

Same name and namespace in other branches
  1. 6.3 tests/potx.test \PotxTestCase::assertPluralIDContext()
  2. 7.3 tests/potx.test \PotxTestCase::assertPluralIDContext()

Helper function to assert an msgid_plural with context in the .po file.

3 calls to PotxTestCase::assertPluralIDContext()
PotxTestCase::testDrupal7 in tests/potx.test
Test parsing of Drupal 7 module.
PotxTestCase::testDrupal8 in tests/potx.test
Test parsing of Drupal 8 module.
PotxTestCase::testDrupalJS in tests/potx.test
Test parsing of a Drupal JS file.

File

tests/potx.test, line 577
Tests to ensure that the template extractor works as intended.

Class

PotxTestCase
@file Tests to ensure that the template extractor works as intended.

Code

private function assertPluralIDContext($string, $plural, $context, $message = '', $group = 'Other') {
  if (!$message) {
    $message = t('Plural ID "@raw" found with context "@context"', array(
      '@raw' => check_plain($string),
      '@context' => $context,
    ));
  }
  $this
    ->assert(strpos($this->potx_output, 'msgctxt "' . _potx_format_quoted_string('"' . $context . '"') . "\"\nmsgid \"" . _potx_format_quoted_string('"' . $string . '"') . "\"\nmsgid_plural \"" . _potx_format_quoted_string('"' . $plural . '"') . '"') !== FALSE, $message, $group);
}