You are here

function DatabaseTaggingTestCase::testExtenderHasTag in Drupal 7

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

File

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

Class

DatabaseTaggingTestCase
Select tagging tests.

Code

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