You are here

TermCacheTagsTest.php in Zircon Profile 8

Same filename and directory in other branches
  1. 8.0 core/modules/taxonomy/src/Tests/TermCacheTagsTest.php

File

core/modules/taxonomy/src/Tests/TermCacheTagsTest.php
View source
<?php

/**
 * @file
 * Contains \Drupal\taxonomy\Tests\TermCacheTagsTest.
 */
namespace Drupal\taxonomy\Tests;

use Drupal\system\Tests\Entity\EntityWithUriCacheTagsTestBase;

/**
 * Tests the Taxonomy term entity's cache tags.
 *
 * @group taxonomy
 */
class TermCacheTagsTest extends EntityWithUriCacheTagsTestBase {

  /**
   * {@inheritdoc}
   */
  public static $modules = array(
    'taxonomy',
  );

  /**
   * {@inheritdoc}
   */
  protected function createEntity() {

    // Create a "Camelids" vocabulary.
    $vocabulary = entity_create('taxonomy_vocabulary', array(
      'name' => 'Camelids',
      'vid' => 'camelids',
    ));
    $vocabulary
      ->save();

    // Create a "Llama" taxonomy term.
    $term = entity_create('taxonomy_term', array(
      'name' => 'Llama',
      'vid' => $vocabulary
        ->id(),
    ));
    $term
      ->save();
    return $term;
  }

}

Classes

Namesort descending Description
TermCacheTagsTest Tests the Taxonomy term entity's cache tags.