function TaxonomyQueryAlterTest::setupQueryTagTestHooks

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

Sets up the hooks in the test module.

1 call to TaxonomyQueryAlterTest::setupQueryTagTestHooks()
TaxonomyQueryAlterTest::testTaxonomyQueryAlter in core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php
Tests that appropriate tags are added when querying the database.

File

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

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);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.