function LocaleLookupTest::setUp
Overrides UnitTestCase::setUp
File
- 
              core/modules/ locale/ tests/ src/ Unit/ LocaleLookupTest.php, line 70 
Class
- LocaleLookupTest
- @coversDefaultClass \Drupal\locale\LocaleLookup[[api-linebreak]] @group locale
Namespace
Drupal\Tests\locale\UnitCode
protected function setUp() : void {
  $this->storage = $this->createMock('Drupal\\locale\\StringStorageInterface');
  $this->cache = $this->createMock('Drupal\\Core\\Cache\\CacheBackendInterface');
  $this->lock = $this->createMock('Drupal\\Core\\Lock\\LockBackendInterface');
  $this->lock
    ->expects($this->never())
    ->method($this->anything());
  $this->user = $this->createMock('Drupal\\Core\\Session\\AccountInterface');
  $this->user
    ->expects($this->any())
    ->method('getRoles')
    ->willReturn([
    'anonymous',
  ]);
  $this->configFactory = $this->getConfigFactoryStub([
    'locale.settings' => [
      'cache_strings' => FALSE,
    ],
  ]);
  $this->languageManager = $this->createMock('Drupal\\Core\\Language\\LanguageManagerInterface');
  $this->requestStack = new RequestStack();
  $container = new ContainerBuilder();
  $container->set('current_user', $this->user);
  \Drupal::setContainer($container);
}Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.
