function TranslationTest::testGet

Same name and namespace in other branches
  1. 9 core/tests/Drupal/Tests/Core/Annotation/TranslationTest.php \Drupal\Tests\Core\Annotation\TranslationTest::testGet()
  2. 8.9.x core/tests/Drupal/Tests/Core/Annotation/TranslationTest.php \Drupal\Tests\Core\Annotation\TranslationTest::testGet()
  3. 10 core/tests/Drupal/Tests/Core/Annotation/TranslationTest.php \Drupal\Tests\Core\Annotation\TranslationTest::testGet()

@covers ::get

@dataProvider providerTestGet

File

core/tests/Drupal/Tests/Core/Annotation/TranslationTest.php, line 39

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 function testGet(array $values, $expected) : void {
    $container = new ContainerBuilder();
    $container->set('string_translation', $this->translationManager);
    \Drupal::setContainer($container);
    $annotation = new Translation($values);
    $this->assertSame($expected, (string) $annotation->get());
}

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