You are here

function DatabaseTaggingTestCase::testHasTag in SimpleTest 7

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

File

tests/database_test.test, line 2058

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'), t('hasTag() returned true.'));
  $this
    ->assertFalse($query
    ->hasTag('other'), t('hasTag() returned false.'));
}