private function UnitTestBase::getEntityTypeManagerMock in Entity Construction Kit (ECK) 8
Retrieves the entity type manager mock.
1 call to UnitTestBase::getEntityTypeManagerMock()
- UnitTestBase::setUp in tests/
src/ Unit/ UnitTestBase.php
File
- tests/
src/ Unit/ UnitTestBase.php, line 98
Class
- UnitTestBase
- Base class for unit tests.
Namespace
Drupal\Tests\eck\UnitCode
private function getEntityTypeManagerMock() {
$entity_storage = $this
->getEntityStorageMock();
$definition = $this
->getMockForAbstractClass(EntityTypeInterface::class);
$entity_type_manager = $this
->getMockForAbstractClass(EntityTypeManagerInterface::class);
$entity_type_manager
->method('getStorage')
->willReturn($entity_storage);
$entity_type_manager
->method('getDefinition')
->willReturn($definition);
return $entity_type_manager;
}