public function TaggingTest::testExtenderHasAllTags in Drupal 8
Same name and namespace in other branches
- 9 core/tests/Drupal/KernelTests/Core/Database/TaggingTest.php \Drupal\KernelTests\Core\Database\TaggingTest::testExtenderHasAllTags()
- 10 core/tests/Drupal/KernelTests/Core/Database/TaggingTest.php \Drupal\KernelTests\Core\Database\TaggingTest::testExtenderHasAllTags()
Tests extended query tagging "has all of these tags" functionality.
File
- core/
tests/ Drupal/ KernelTests/ Core/ Database/ TaggingTest.php, line 76
Class
- TaggingTest
- Tests the tagging capabilities of the Select builder.
Namespace
Drupal\KernelTests\Core\DatabaseCode
public function testExtenderHasAllTags() {
$query = $this->connection
->select('test')
->extend('Drupal\\Core\\Database\\Query\\SelectExtender');
$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.');
}