protected function FieldApiDataTest::getViewsData in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/views/src/Tests/FieldApiDataTest.php \Drupal\views\Tests\FieldApiDataTest::getViewsData()
Gets the views data for the field created in setUp().
Return value
array
1 call to FieldApiDataTest::getViewsData()
- FieldApiDataTest::testViewsData in core/
modules/ views/ src/ Tests/ FieldApiDataTest.php - Unit testing the views data structure.
File
- core/
modules/ views/ src/ Tests/ FieldApiDataTest.php, line 128 - Contains \Drupal\views\Tests\FieldApiDataTest.
Class
- FieldApiDataTest
- Tests the Field Views data.
Namespace
Drupal\views\TestsCode
protected function getViewsData() {
$views_data = $this->container
->get('views.views_data');
$data = array();
// Check the table and the joins of the first field.
// Attached to node only.
/** @var \Drupal\Core\Entity\Sql\DefaultTableMapping $table_mapping */
$table_mapping = \Drupal::entityManager()
->getStorage('node')
->getTableMapping();
$current_table = $table_mapping
->getDedicatedDataTableName($this->fieldStorages[0]);
$revision_table = $table_mapping
->getDedicatedRevisionTableName($this->fieldStorages[0]);
$data[$current_table] = $views_data
->get($current_table);
$data[$revision_table] = $views_data
->get($revision_table);
return $data;
}