function TranslationTest::providerTestGet

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Annotation/TranslationTest.php \Drupal\Tests\Core\Annotation\TranslationTest::providerTestGet()
  2. 8.9.x core/tests/Drupal/Tests/Core/Annotation/TranslationTest.php \Drupal\Tests\Core\Annotation\TranslationTest::providerTestGet()
  3. 10 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 52

Class

TranslationTest
@coversDefaultClass <a href="/api/drupal/core%21lib%21Drupal%21Core%21Annotation%21Translation.php/class/Translation/11.x" title="Defines a translatable annotation object." class="local">\Drupal\Core\Annotation\Translation</a> @group Annotation

Namespace

Drupal\Tests\Core\Annotation

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.