You are here

private function UnitTestBase::getEntityStorageMock in Entity Construction Kit (ECK) 8

Retrieves the entity storage mock.

2 calls to UnitTestBase::getEntityStorageMock()
UnitTestBase::getEntityManagerMock in tests/src/Unit/UnitTestBase.php
Retrieves the entity manager mock.
UnitTestBase::getEntityTypeManagerMock in tests/src/Unit/UnitTestBase.php
Retrieves the entity type manager mock.

File

tests/src/Unit/UnitTestBase.php, line 67

Class

UnitTestBase
Base class for unit tests.

Namespace

Drupal\Tests\eck\Unit

Code

private function getEntityStorageMock() {
  $entity_storage = $this
    ->getMockForAbstractClass('\\Drupal\\Core\\Entity\\EntityStorageInterface');
  $entity_storage
    ->method('loadMultiple')
    ->willReturnCallback([
    $this,
    'entityStorageLoadMultiple',
  ]);
  $entity_storage
    ->method('load')
    ->willReturnCallback([
    $this,
    'entityStorageLoadMultiple',
  ]);
  return $entity_storage;
}