1 database_test.test DatabaseTaggingTestCase::testHasTag()

Confirm that a query has a "tag" added to it.

File

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

Class

DatabaseTaggingTestCase
Select tagging tests.

Code

function testHasTag() {
  $query = db_select('test');
  $query->addField('test', 'name');
  $query->addField('test', 'age', 'age');

  $query->addTag('test');

  $this->assertTrue($query->hasTag('test'), 'hasTag() returned true.');
  $this->assertFalse($query->hasTag('other'), 'hasTag() returned false.');
}