function TaxonomyQueryAlterTest::setupQueryTagTestHooks

Same name in other branches
  1. 9 core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php \Drupal\Tests\taxonomy\Kernel\TaxonomyQueryAlterTest::setupQueryTagTestHooks()
  2. 10 core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php \Drupal\Tests\taxonomy\Kernel\TaxonomyQueryAlterTest::setupQueryTagTestHooks()
  3. 11.x 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 120

Class

TaxonomyQueryAlterTest
Tests that appropriate query tags are added.

Namespace

Drupal\Tests\taxonomy\Kernel

Code

protected function setupQueryTagTestHooks() {
    taxonomy_terms_static_reset();
    $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.