public function FieldHelper::getEntityTypeBundleInfoMock in Feeds Paragraphs 8
Return value
File
- tests/
src/ Unit/ Helpers/ FieldHelper.php, line 204
Class
Namespace
Drupal\Tests\feeds_para_mapper\Unit\HelpersCode
public function getEntityTypeBundleInfoMock() {
$bundleInfo = $this->prophet
->prophesize(EntityTypeBundleInfoInterface::class);
$that = $this;
$bundleInfo
->getBundleInfo(Argument::type('string'))
->will(function ($args) use ($that) {
if ($args[0] === 'paragraph') {
$bundles = [];
foreach ($that->bundles as $bundle) {
$bundles[$bundle]['name'] = $bundle;
$bundles[$bundle]['label'] = $bundle;
}
return $bundles;
}
return null;
});
return $bundleInfo
->reveal();
}