function TaxonomyQueryAlterTest::assertQueryTagTestResult
Same name in other branches
- 9 core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php \Drupal\Tests\taxonomy\Kernel\TaxonomyQueryAlterTest::assertQueryTagTestResult()
- 10 core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php \Drupal\Tests\taxonomy\Kernel\TaxonomyQueryAlterTest::assertQueryTagTestResult()
- 11.x core/modules/taxonomy/tests/src/Kernel/TaxonomyQueryAlterTest.php \Drupal\Tests\taxonomy\Kernel\TaxonomyQueryAlterTest::assertQueryTagTestResult()
Verifies invocation of the hooks in the test module.
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.
1 call to TaxonomyQueryAlterTest::assertQueryTagTestResult()
- 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 138
Class
- TaxonomyQueryAlterTest
- Tests that appropriate query tags are added.
Namespace
Drupal\Tests\taxonomy\KernelCode
protected function assertQueryTagTestResult($expected_generic_invocations, $expected_specific_invocations) {
$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'));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.