protected function FieldAccessCheckTest::setUp in FileField Sources 8
Overrides UnitTestCase::setUp
File
- tests/
src/ Unit/ FieldAccessCheckTest.php, line 29
Class
- FieldAccessCheckTest
- @coversDefaultClass \Drupal\filefield_sources\Access\FieldAccessCheck @group Access
Namespace
Drupal\Tests\filefield_sources\UnitCode
protected function setUp() : void {
$field_definition = $this
->createMock(FieldDefinitionInterface::class);
$field_storage = $this
->createMock(EntityStorageInterface::class);
$field_storage
->expects($this
->any())
->method('load')
->willReturn($field_definition);
$this->entityTypeManager = $this
->createMock(EntityTypeManagerInterface::class);
$this->entityTypeManager
->expects($this
->any())
->method('getStorage')
->willReturn($field_storage);
$container = new Container();
\Drupal::setContainer($container);
}