You are here

public function TaxonomyEntityIndexFieldNamesTest::testFieldNamesUpdate in Taxonomy Entity Index 8

Tests caching in taxonomy_entity_index_get_taxonomy_field_names().

File

tests/src/Kernel/TaxonomyEntityIndexFieldNamesTest.php, line 23

Class

TaxonomyEntityIndexFieldNamesTest
Defines a class for testing .

Namespace

Drupal\Tests\taxonomy_entity_index\Kernel

Code

public function testFieldNamesUpdate() {
  $fields = taxonomy_entity_index_get_taxonomy_field_names('entity_test');
  $this
    ->assertEquals([
    'test' => [
      'termz',
    ],
  ], $fields);
  drupal_static_reset('entity-taxonomy-fields_entity_test');
  drupal_static_reset('entity-taxonomy-field-defs_entity_test_test');
  $this
    ->setupTermField('entity_test', 'test', 'another_field');
  $fields = taxonomy_entity_index_get_taxonomy_field_names('entity_test');
  $this
    ->assertEquals([
    'test' => [
      'termz',
      'another_field',
    ],
  ], $fields);
}