private function AccessStorageTest::mockFormState in Permissions by Term 8.2
Same name and namespace in other branches
- 8 tests/src/Kernel/AccessStorageTest.php \Drupal\Tests\permissions_by_term\Kernel\AccessStorageTest::mockFormState()
1 call to AccessStorageTest::mockFormState()
- AccessStorageTest::testSaveMultipleLanguageCodes in tests/
src/ Kernel/ AccessStorageTest.php
File
- tests/
src/ Kernel/ AccessStorageTest.php, line 20
Class
- AccessStorageTest
- @group permissions_by_term
Namespace
Drupal\Tests\permissions_by_term\KernelCode
private function mockFormState(string $langcode, array $accessOutput) {
$formStateStub = $this
->getMockBuilder(FormStateInterface::class)
->getMock();
$map = [
[
'langcode',
NULL,
[
[
'value' => $langcode,
],
],
],
[
'access',
NULL,
$accessOutput,
],
];
$formStateStub
->expects($this
->any())
->method('getValue')
->will($this
->returnValueMap($map));
return $formStateStub;
}