You are here

protected function AuthenticationAnonymousTest::createAuthenticationPlugin in Entity Share 8.3

Helper function to create the authentication plugin.

Parameters

\Drupal\user\UserInterface $user: The user whose credentials will be used for the plugin.

\Drupal\entity_share_client\Entity\RemoteInterface $remote: The "Remote" entity.

Return value

\Drupal\entity_share_client\ClientAuthorization\ClientAuthorizationInterface The Entity share Authorization plugin.

Overrides EntityShareClientFunctionalTestBase::createAuthenticationPlugin

File

modules/entity_share_client/tests/src/Functional/AuthenticationAnonymousTest.php, line 42

Class

AuthenticationAnonymousTest
Functional test class for import with "Anonymous" authorization.

Namespace

Drupal\Tests\entity_share_client\Functional

Code

protected function createAuthenticationPlugin(UserInterface $user, RemoteInterface $remote) {
  $plugin = $this->authPluginManager
    ->createInstance('anonymous');
  $configuration = $plugin
    ->getConfiguration();
  $configuration['data'] = [
    'credential_provider' => 'entity_share',
    'storage_key' => $configuration['uuid'],
  ];
  $plugin
    ->setConfiguration($configuration);
  return $plugin;
}