You are here

protected function TaxonomyQueryAlterTest::assertQueryTagTestResult 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::assertQueryTagTestResult()
  2. 9 core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php \Drupal\Tests\taxonomy\Kernel\TaxonomyQueryAlterTest::assertQueryTagTestResult()

Verifies invocation of the hooks in the test module.

@internal

Parameters

int $expected_generic_invocations: The number of times the generic query_alter hook is expected to have been invoked.

int $expected_specific_invocations: The number of times the tag-specific query_alter hooks are expected to have been invoked.

File

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

Class

TaxonomyQueryAlterTest
Tests that appropriate query tags are added.

Namespace

Drupal\Tests\taxonomy\Kernel

Code

protected function assertQueryTagTestResult(int $expected_generic_invocations, int $expected_specific_invocations) : void {
  $state = $this->container
    ->get('state');
  $this
    ->assertEquals($expected_generic_invocations, $state
    ->get('taxonomy_test_query_alter'));
  $this
    ->assertEquals($expected_specific_invocations, $state
    ->get('taxonomy_test_query_term_access_alter'));
  $this
    ->assertEquals($expected_specific_invocations, $state
    ->get('taxonomy_test_query_taxonomy_term_access_alter'));
}