protected function EntityHelper::getStorageMock in Feeds Paragraphs 8
Return value
ObjectProphecy A storage instance.
File
- tests/
src/ Unit/ Helpers/ EntityHelper.php, line 231
Class
Namespace
Drupal\Tests\feeds_para_mapper\Unit\HelpersCode
protected function getStorageMock() {
$storage = $this->prophet
->prophesize(EntityStorageInterface::class);
$that = $this;
$storage
->create(Argument::type('array'))
->will(function ($args) use ($that) {
$bundle = $args[0]['type'];
$id = random_int(10, 10);
return $that
->getEntity('paragraph', $bundle, $id)
->reveal();
});
$storage
->load(Argument::any())
->will(function ($args) use ($that) {
$id = $args[0];
return $that->paragraphs[$id];
});
return $storage;
}