public function EntityFinderTest::testFindMultipleEntities in Feeds 8.3
@covers ::findEntities
File
- tests/
src/ Unit/ EntityFinderTest.php, line 100
Class
- EntityFinderTest
- @coversDefaultClass \Drupal\feeds\EntityFinder @group feeds
Namespace
Drupal\Tests\feeds\UnitCode
public function testFindMultipleEntities() {
// Entity query.
$entity_query = $this
->prophesize(QueryInterface::class);
$entity_query
->range(0, 1)
->shouldNotBeCalled();
$entity_query
->condition('field_ref', 1)
->willReturn($entity_query);
$entity_query
->execute()
->willReturn([
12,
13,
14,
]);
$this->entityStorage
->getQuery()
->willReturn($entity_query)
->shouldBeCalled();
$entity_ids = $this
->createEntityFinderInstance()
->findEntities('foo', 'field_ref', 1, [], TRUE);
$this
->assertEquals([
12,
13,
14,
], $entity_ids);
}