You are here

public function TranslationTest::testGet in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 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
Contains \Drupal\Tests\Core\Annotation\TranslationTest.

Class

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

Namespace

Drupal\Tests\Core\Annotation

Code

public function testGet(array $values, $expected) {
  $container = new ContainerBuilder();
  $container
    ->set('string_translation', $this->translationManager);
  \Drupal::setContainer($container);
  $arguments = isset($values['arguments']) ? $values['arguments'] : array();
  $options = isset($values['context']) ? array(
    'context' => $values['context'],
  ) : array();
  $annotation = new Translation($values);
  $this
    ->assertSame($expected, (string) $annotation
    ->get());
}