function EntityQueryTest::testBaseFieldMultipleColumns
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php \Drupal\KernelTests\Core\Entity\EntityQueryTest::testBaseFieldMultipleColumns()
- 10 core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php \Drupal\KernelTests\Core\Entity\EntityQueryTest::testBaseFieldMultipleColumns()
- 11.x core/tests/Drupal/KernelTests/Core/Entity/EntityQueryTest.php \Drupal\KernelTests\Core\Entity\EntityQueryTest::testBaseFieldMultipleColumns()
Test base fields with multiple columns.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Entity/ EntityQueryTest.php, line 968
Class
- EntityQueryTest
- Tests Entity Query functionality.
Namespace
Drupal\KernelTests\Core\EntityCode
public function testBaseFieldMultipleColumns() {
$this->enableModules([
'taxonomy',
]);
$this->installEntitySchema('taxonomy_term');
Vocabulary::create([
'vid' => 'tags',
]);
$term1 = Term::create([
'name' => $this->randomMachineName(),
'vid' => 'tags',
'description' => [
'value' => $this->randomString(),
'format' => 'format1',
],
]);
$term1->save();
$term2 = Term::create([
'name' => $this->randomMachineName(),
'vid' => 'tags',
'description' => [
'value' => $this->randomString(),
'format' => 'format2',
],
]);
$term2->save();
$ids = $this->container
->get('entity_type.manager')
->getStorage('taxonomy_term')
->getQuery()
->condition('description.format', 'format1')
->execute();
$this->assertCount(1, $ids);
$this->assertEqual($term1->id(), reset($ids));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.