function TaggingTest::testHasTag
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Database/TaggingTest.php \Drupal\KernelTests\Core\Database\TaggingTest::testHasTag()
- 8.9.x core/tests/Drupal/KernelTests/Core/Database/TaggingTest.php \Drupal\KernelTests\Core\Database\TaggingTest::testHasTag()
- 11.x core/tests/Drupal/KernelTests/Core/Database/TaggingTest.php \Drupal\KernelTests\Core\Database\TaggingTest::testHasTag()
Confirms that a query has a tag added to it.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Database/ TaggingTest.php, line 22
Class
- TaggingTest
- Tests the tagging capabilities of the Select builder.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testHasTag() : void {
$query = $this->connection
->select('test');
$query->addField('test', 'name');
$query->addField('test', 'age', 'age');
$query->addTag('test');
$this->assertTrue($query->hasTag('test'), 'hasTag() returned true.');
$this->assertFalse($query->hasTag('other'), 'hasTag() returned false.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.