1 database_test.test DatabaseTaggingTestCase::testExtenderHasAnyTag()

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

File

core/modules/simpletest/tests/database_test.test, line 2598
Database tests.

Class

DatabaseTaggingTestCase
Select tagging tests.

Code

function testExtenderHasAnyTag() {
  $query = db_select('test')
    ->extend('SelectQueryExtender');
  $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.');
}