function EntityQueryTest::testMetaData
Same name in other branches
- 8.9.x core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php \Drupal\KernelTests\Core\Entity\EntityQueryTest::testMetaData()
- 10 core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php \Drupal\KernelTests\Core\Entity\EntityQueryTest::testMetaData()
- 11.x core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php \Drupal\KernelTests\Core\Entity\EntityQueryTest::testMetaData()
Tests adding a tag and metadata to the Entity query object.
The tags and metadata should propagate to the SQL query object.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Entity/ EntityQueryTest.php, line 791
Class
- EntityQueryTest
- Tests Entity Query functionality.
Namespace
Drupal\KernelTests\Core\EntityCode
public function testMetaData() {
field_test_memorize();
$query = $this->storage
->getQuery()
->accessCheck(FALSE);
$query->addTag('efq_metadata_test')
->addMetaData('foo', 'bar')
->execute();
$mem = field_test_memorize();
$this->assertEquals('bar', $mem['field_test_query_efq_metadata_test_alter'][0], 'Tag and metadata propagated to the SQL query object.');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.