function DatabaseTaggingTestCase::testHasAnyTag

Test query tagging "has at least one of these tags" functionality.

File

modules/simpletest/tests/database_test.test, line 2835

Class

DatabaseTaggingTestCase
Select tagging tests.

Code

function testHasAnyTag() {
    $query = db_select('test');
    $query->addField('test', 'name');
    $query->addField('test', 'age', 'age');
    $query->addTag('test');
    $this->assertTrue($query->hasAnyTag('test', 'other'), 'hasAnyTag() returned true.');
    $this->assertFalse($query->hasAnyTag('other', 'stuff'), 'hasAnyTag() returned false.');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.