You are here

public function EntityQueryTest::testMetaData in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/src/Tests/Entity/EntityQueryTest.php \Drupal\system\Tests\Entity\EntityQueryTest::testMetaData()

Test adding a tag and metadata to the Entity query object.

The tags and metadata should propagate to the SQL query object.

File

core/modules/system/src/Tests/Entity/EntityQueryTest.php, line 566
Contains \Drupal\system\Tests\Entity\EntityQueryTest.

Class

EntityQueryTest
Tests Entity Query functionality.

Namespace

Drupal\system\Tests\Entity

Code

public function testMetaData() {
  $query = \Drupal::entityQuery('entity_test_mulrev');
  $query
    ->addTag('efq_metadata_test')
    ->addMetaData('foo', 'bar')
    ->execute();
  global $efq_test_metadata;
  $this
    ->assertEqual($efq_test_metadata, 'bar', 'Tag and metadata propagated to the SQL query object.');
}