You are here

function PotxTestD8::testFormatPlural in Translation template extractor 6.3

Same name and namespace in other branches
  1. 7.2 tests/potx_test_8.module \PotxTestD8::testFormatPlural()

File

tests/potx_test_8.module, line 72
File used purely to test the parser in potx.

Class

PotxTestD8
Test parsing Drupal 8 $this->t and formatPlural function calls.

Code

function testFormatPlural() {
  $this
    ->formatPlural($count, '1 formatPlural test string', '@count formatPlural test strings');
  $this
    ->formatPlural($count, '1 formatPlural test string in context', '@count formatPlural test strings in context', array(), array(
    'context' => 'Test context',
  ));
  $this
    ->formatPlural($count);
  $this
    ->formatPlural();
  \Drupal::translation()
    ->formatPlural($count, '1 translation->formatPlural test string in context', '@count translation->formatPlural test strings in context', array(), array(
    'context' => 'Test context',
  ));
  \Drupal::translation()
    ->formatPlural($count, '1 translation->formatPlural test string', '@count translation->formatPlural test strings');
  $a = new PluralTranslatableMarkup($count, '1 PluralTranslatableMarkup test string', '@count PluralTranslatableMarkup test strings');
  $b = new PluralTranslatableMarkup($count, '1 PluralTranslatableMarkup test string with context', '@count PluralTranslatableMarkup test strings with context', array(), array(
    'context' => 'Test context',
  ));
}