function TaggingTest::testExtenderHasAllTags in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/system/src/Tests/Database/TaggingTest.php \Drupal\system\Tests\Database\TaggingTest::testExtenderHasAllTags()
Tests extended query tagging "has all of these tags" functionality.
File
- core/
modules/ system/ src/ Tests/ Database/ TaggingTest.php, line 81 - Contains \Drupal\system\Tests\Database\TaggingTest.
Class
- TaggingTest
- Tests the tagging capabilities of the Select builder.
Namespace
Drupal\system\Tests\DatabaseCode
function testExtenderHasAllTags() {
$query = db_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.');
}