You are here

function TaggingTest::testHasAllTags in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/src/Tests/Database/TaggingTest.php \Drupal\system\Tests\Database\TaggingTest::testHasAllTags()

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

File

core/modules/system/src/Tests/Database/TaggingTest.php, line 37
Contains \Drupal\system\Tests\Database\TaggingTest.

Class

TaggingTest
Tests the tagging capabilities of the Select builder.

Namespace

Drupal\system\Tests\Database

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.');
}