class TermCacheTagsTest in Drupal 10
Same name and namespace in other branches
- 8 core/modules/taxonomy/tests/src/Functional/TermCacheTagsTest.php \Drupal\Tests\taxonomy\Functional\TermCacheTagsTest
- 9 core/modules/taxonomy/tests/src/Functional/TermCacheTagsTest.php \Drupal\Tests\taxonomy\Functional\TermCacheTagsTest
Tests the Taxonomy term entity's cache tags.
@group taxonomy
Hierarchy
- class \Drupal\Tests\BrowserTestBase extends \PHPUnit\Framework\TestCase uses \Drupal\Tests\PhpUnitCompatibilityTrait, \Symfony\Bridge\PhpUnit\ExpectDeprecationTrait, FunctionalTestSetupTrait, TestSetupTrait, BlockCreationTrait, ConfigTestTrait, ExtensionListTestTrait, ContentTypeCreationTrait, NodeCreationTrait, RandomGeneratorTrait, TestRequirementsTrait, PhpUnitWarnings, UiHelperTrait, UserCreationTrait, XdebugRequestTrait
- class \Drupal\Tests\system\Functional\Cache\PageCacheTagsTestBase
- class \Drupal\Tests\system\Functional\Entity\EntityCacheTagsTestBase
- class \Drupal\Tests\system\Functional\Entity\EntityWithUriCacheTagsTestBase
- class \Drupal\Tests\taxonomy\Functional\TermCacheTagsTest
- class \Drupal\Tests\system\Functional\Entity\EntityWithUriCacheTagsTestBase
- class \Drupal\Tests\system\Functional\Entity\EntityCacheTagsTestBase
- class \Drupal\Tests\system\Functional\Cache\PageCacheTagsTestBase
Expanded class hierarchy of TermCacheTagsTest
File
- core/
modules/ taxonomy/ tests/ src/ Functional/ TermCacheTagsTest.php, line 14
Namespace
Drupal\Tests\taxonomy\FunctionalView source
class TermCacheTagsTest extends EntityWithUriCacheTagsTestBase {
/**
* {@inheritdoc}
*/
protected static $modules = [
'taxonomy',
];
/**
* {@inheritdoc}
*/
protected $defaultTheme = 'stark';
/**
* {@inheritdoc}
*/
protected function createEntity() {
// Create a "Camelids" vocabulary.
$vocabulary = Vocabulary::create([
'name' => 'Camelids',
'vid' => 'camelids',
]);
$vocabulary
->save();
// Create a "Llama" taxonomy term.
$term = Term::create([
'name' => 'Llama',
'vid' => $vocabulary
->id(),
]);
$term
->save();
return $term;
}
}