You are here

protected function EntityShareClientFunctionalTestBase::createChannel in Entity Share 8.3

Same name and namespace in other branches
  1. 8.2 modules/entity_share_client/tests/src/Functional/EntityShareClientFunctionalTestBase.php \Drupal\Tests\entity_share_client\Functional\EntityShareClientFunctionalTestBase::createChannel()

Helper function to create the channel used for the test.

Parameters

\Drupal\user\UserInterface $user: The user which credential will be used for the remote.

7 calls to EntityShareClientFunctionalTestBase::createChannel()
BasicFieldsTest::createChannel in modules/entity_share_client/tests/src/Functional/BasicFieldsTest.php
Helper function to create the channel used for the test.
ChangedRemovedTest::createChannel in modules/entity_share_client/tests/src/Functional/ChangedRemovedTest.php
Helper function to create the channel used for the test.
EntityShareClientFunctionalTestBase::setUp in modules/entity_share_client/tests/src/Functional/EntityShareClientFunctionalTestBase.php
MissingEntityReferenceTest::createChannel in modules/entity_share_client/tests/src/Functional/MissingEntityReferenceTest.php
Helper function to create the channel used for the test.
MissingFieldsTest::createChannel in modules/entity_share_client/tests/src/Functional/MissingFieldsTest.php
Helper function to create the channel used for the test.

... See full list

6 methods override EntityShareClientFunctionalTestBase::createChannel()
BasicFieldsTest::createChannel in modules/entity_share_client/tests/src/Functional/BasicFieldsTest.php
Helper function to create the channel used for the test.
ChangedRemovedTest::createChannel in modules/entity_share_client/tests/src/Functional/ChangedRemovedTest.php
Helper function to create the channel used for the test.
MissingEntityReferenceTest::createChannel in modules/entity_share_client/tests/src/Functional/MissingEntityReferenceTest.php
Helper function to create the channel used for the test.
MissingFieldsTest::createChannel in modules/entity_share_client/tests/src/Functional/MissingFieldsTest.php
Helper function to create the channel used for the test.
MultilingualTest::createChannel in modules/entity_share_client/tests/src/Functional/MultilingualTest.php
Helper function to create the channel used for the test.

... See full list

File

modules/entity_share_client/tests/src/Functional/EntityShareClientFunctionalTestBase.php, line 359

Class

EntityShareClientFunctionalTestBase
Base class for Entity Share Client functional tests.

Namespace

Drupal\Tests\entity_share_client\Functional

Code

protected function createChannel(UserInterface $user) {
  $channel_storage = $this->entityTypeManager
    ->getStorage('channel');
  $channel = $channel_storage
    ->create([
    'id' => static::$entityTypeId . '_' . static::$entityBundleId . '_' . static::$entityLangcode,
    'label' => $this
      ->randomString(),
    'channel_entity_type' => static::$entityTypeId,
    'channel_bundle' => static::$entityBundleId,
    'channel_langcode' => static::$entityLangcode,
    'authorized_users' => [
      $user
        ->uuid(),
    ],
  ]);
  $channel
    ->save();
  $this->channels[$channel
    ->id()] = $channel;
}