You are here

protected function NameFormatParserTest::setUp in Name Field 8

Overrides UnitTestCase::setUp

File

tests/src/Unit/NameFormatParserTest.php, line 26

Class

NameFormatParserTest
Tests the name formatter.

Namespace

Drupal\Tests\name\Unit

Code

protected function setUp() {
  parent::setUp();
  $test_settings = [
    'name.settings' => [
      'sep1' => ',',
      'sep2' => ' ',
      'sep3' => '',
    ],
  ];
  $config_factory = $this
    ->getConfigFactoryStub($test_settings);
  $container = new ContainerBuilder();
  $container
    ->set('config.factory', $config_factory);
  $container
    ->set('string_translation', $this
    ->getStringTranslationStub());
  \Drupal::setContainer($container);
  $this->parser = new NameFormatParser($config_factory);
}