You are here

public function TranslationTest::providerTestGet in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/Tests/Core/Annotation/TranslationTest.php \Drupal\Tests\Core\Annotation\TranslationTest::providerTestGet()

Provides data to self::testGet().

File

core/tests/Drupal/Tests/Core/Annotation/TranslationTest.php, line 57
Contains \Drupal\Tests\Core\Annotation\TranslationTest.

Class

TranslationTest
@coversDefaultClass \Drupal\Core\Annotation\Translation @group Annotation

Namespace

Drupal\Tests\Core\Annotation

Code

public function providerTestGet() {
  $data = array();
  $data[] = array(
    array(
      'value' => 'Foo',
    ),
    'Foo',
  );
  $random = $this
    ->randomMachineName();
  $random_html_entity = '&' . $random;
  $data[] = array(
    array(
      'value' => 'Foo @bar @baz %qux',
      'arguments' => array(
        '@bar' => $random,
        '@baz' => $random_html_entity,
        '%qux' => $random_html_entity,
      ),
      'context' => $this
        ->randomMachineName(),
    ),
    'Foo ' . $random . ' &amp;' . $random . ' <em class="placeholder">&amp;' . $random . '</em>',
  );
  return $data;
}