protected function UserRoleTest::createTargetPluginInstance in Feeds 8.3
Creates a new target plugin instance.
Parameters
array $configuration: (optional) The configuration for the target plugin.
Return value
\Drupal\feeds\Plugin\Type\Target\TargetInterface A FeedsTarget plugin instance.
Overrides EntityReferenceTestBase::createTargetPluginInstance
5 calls to UserRoleTest::createTargetPluginInstance()
- UserRoleTest::testPrepareValue in tests/
src/ Unit/ Feeds/ Target/ UserRoleTest.php - Tests finding a role by label.
- UserRoleTest::testPrepareValueEmptyFeedWithAutoCreateRole in tests/
src/ Unit/ Feeds/ Target/ UserRoleTest.php - Tests prepareValue() with passing a space as value.
- UserRoleTest::testPrepareValueNonAllowedRole in tests/
src/ Unit/ Feeds/ Target/ UserRoleTest.php - Tests referencing a non-allowed role.
- UserRoleTest::testPrepareValueReferenceNotFound in tests/
src/ Unit/ Feeds/ Target/ UserRoleTest.php - Tests prepareValue() method without match.
- UserRoleTest::testPrepareValueWithNewRole in tests/
src/ Unit/ Feeds/ Target/ UserRoleTest.php - Tests referencing a newly created role.
File
- tests/
src/ Unit/ Feeds/ Target/ UserRoleTest.php, line 68
Class
- UserRoleTest
- @coversDefaultClass \Drupal\feeds\Feeds\Target\UserRole @group feeds
Namespace
Drupal\Tests\feeds\Unit\Feeds\TargetCode
protected function createTargetPluginInstance(array $configuration = []) {
$configuration += [
'feed_type' => $this
->createMock(FeedTypeInterface::class),
'target_definition' => $this
->createTargetDefinitionMock(),
'reference_by' => 'label',
];
return new UserRole($configuration, 'user_role', [], $this->entityTypeManager
->reveal(), $this->entityFinder
->reveal(), $this->transliteration
->reveal(), $this->typedConfigManager
->reveal());
}