You are here

protected function ContentGenerationTrait::randomEntity in Workbench Moderation to Content Moderation 8.2

8 calls to ContentGenerationTrait::randomEntity()
ContentGenerationTrait::generateFieldData in tests/src/Kernel/ContentGenerationTrait.php
MigrationTestTrait::randomBundle in tests/src/Kernel/MigrationTestTrait.php
Returns a randomly chosen bundle ID of the entity type under test.
TestBase::testMultipleRevisionsWithNewTranslation in tests/src/Functional/TestBase.php
Migrates an entity with several revisions, one of which adds a translation.
TestBase::testMultipleTranslatedMixedRevisions in tests/src/Functional/TestBase.php
Migrates an entity with several revisions and translations.
TestBase::testMultipleTranslatedRevisions in tests/src/Functional/TestBase.php
Migrates an entity with several revisions, all of which are translated.

... See full list

File

tests/src/Kernel/ContentGenerationTrait.php, line 124

Class

ContentGenerationTrait

Namespace

Drupal\Tests\wbm2cm\Kernel

Code

protected function randomEntity($entity_type) {
  $items = $this
    ->query($entity_type)
    ->execute();
  shuffle($items);
  return reset($items);
}