protected function LocaleLookupTest::setUp in Drupal 10
Same name and namespace in other branches
- 8 core/modules/locale/tests/src/Unit/LocaleLookupTest.php \Drupal\Tests\locale\Unit\LocaleLookupTest::setUp()
- 9 core/modules/locale/tests/src/Unit/LocaleLookupTest.php \Drupal\Tests\locale\Unit\LocaleLookupTest::setUp()
File
- core/
modules/ locale/ tests/ src/ Unit/ LocaleLookupTest.php, line 70
Class
- LocaleLookupTest
- @coversDefaultClass \Drupal\locale\LocaleLookup @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')
->will($this
->returnValue([
'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);
}