You are here

public function EntityFinderTest::testFindEntitiesNotFound in Feeds 8.3

@covers ::findEntities

File

tests/src/Unit/EntityFinderTest.php, line 85

Class

EntityFinderTest
@coversDefaultClass \Drupal\feeds\EntityFinder @group feeds

Namespace

Drupal\Tests\feeds\Unit

Code

public function testFindEntitiesNotFound() {

  // Entity query.
  $entity_query = $this
    ->prophesize(QueryInterface::class);
  $entity_query
    ->range(0, 1)
    ->willReturn($entity_query);
  $entity_query
    ->condition('field_ref', 1)
    ->willReturn($entity_query);
  $entity_query
    ->execute()
    ->willReturn([]);
  $this->entityStorage
    ->getQuery()
    ->willReturn($entity_query)
    ->shouldBeCalled();
  $entity_ids = $this
    ->createEntityFinderInstance()
    ->findEntities('foo', 'field_ref', 1);
  $this
    ->assertEquals([], $entity_ids);
}