You are here

protected function TaxonomyQueryAlterTest::setupQueryTagTestHooks in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php \Drupal\Tests\taxonomy\Kernel\TaxonomyQueryAlterTest::setupQueryTagTestHooks()
  2. 9 core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php \Drupal\Tests\taxonomy\Kernel\TaxonomyQueryAlterTest::setupQueryTagTestHooks()

Sets up the hooks in the test module.

File

core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php, line 120

Class

TaxonomyQueryAlterTest
Tests that appropriate query tags are added.

Namespace

Drupal\Tests\taxonomy\Kernel

Code

protected function setupQueryTagTestHooks() {
  $this->container
    ->get('entity_type.manager')
    ->getStorage('taxonomy_term')
    ->resetCache();
  $state = $this->container
    ->get('state');
  $state
    ->set('taxonomy_test_query_alter', 0);
  $state
    ->set('taxonomy_test_query_term_access_alter', 0);
  $state
    ->set('taxonomy_test_query_taxonomy_term_access_alter', 0);
}