1 database_test.test DatabaseTaggingTestCase::testHasAllTags()

Test query tagging "has all of these tags" functionality.

File

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

Class

DatabaseTaggingTestCase
Select tagging tests.

Code

function testHasAllTags() {
  $query = db_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.');
}