public function TaggingTest::testHasAllTags in Drupal 9
Same name and namespace in other branches
- 8 core/tests/Drupal/KernelTests/Core/Database/TaggingTest.php \Drupal\KernelTests\Core\Database\TaggingTest::testHasAllTags()
Tests query tagging "has all of these tags" functionality.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Database/ TaggingTest.php, line 34
Class
- TaggingTest
- Tests the tagging capabilities of the Select builder.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testHasAllTags() {
$query = $this->connection
->select('test');
$query
->addField('test', 'name');
$query
->addField('test', 'age', 'age');
$query
->addTag('test');
$query
->addTag('other');
$this
->assertTrue($query
->hasAllTags('test', 'other'), 'hasAllTags() returned true.');
$this
->assertFalse($query
->hasAllTags('test', 'stuff'), 'hasAllTags() returned false.');
}