You are here

protected function TaxonomyEntityIndexTermArgumentDepthTest::setupMediaTypeWithTaxonomy in Taxonomy Entity Index 8

Creates a media type with a taxonomy field to use for testing.

1 call to TaxonomyEntityIndexTermArgumentDepthTest::setupMediaTypeWithTaxonomy()
TaxonomyEntityIndexTermArgumentDepthTest::setUp in tests/src/Functional/Views/TaxonomyEntityIndexTermArgumentDepthTest.php

File

tests/src/Functional/Views/TaxonomyEntityIndexTermArgumentDepthTest.php, line 124

Class

TaxonomyEntityIndexTermArgumentDepthTest
Tests the taxonomy term with depth argument.

Namespace

Drupal\Tests\taxonomy_entity_index\Functional\Views

Code

protected function setupMediaTypeWithTaxonomy() {
  $media_type = $this
    ->createMediaType('file', [
    'id' => 'document',
    'label' => 'Document',
  ]);
  $handler_settings = [
    'target_bundles' => [
      $this->vocabulary
        ->id() => $this->vocabulary
        ->id(),
    ],
    'auto_create' => TRUE,
  ];

  // Create the taxonomy term reference field on the media.
  $this
    ->createEntityReferenceField('media', 'document', 'field_views_testing_tags', 'Tags', 'taxonomy_term', 'default', $handler_settings, FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED);
}