public static function ViewTestData::viewsData in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/views/src/Tests/ViewTestData.php \Drupal\views\Tests\ViewTestData::viewsData()
Returns the views data definition.
4 calls to ViewTestData::viewsData()
- ViewKernelTestBase::viewsData in core/
modules/ views/ src/ Tests/ ViewKernelTestBase.php - Returns the views data definition.
- ViewsDataHelperTest::viewsData in core/
modules/ views/ tests/ src/ Unit/ ViewsDataHelperTest.php - Returns the views data definition.
- ViewsDataTest::viewsData in core/
modules/ views/ tests/ src/ Unit/ ViewsDataTest.php - Returns the views data definition.
- ViewTestBase::viewsData in core/
modules/ views/ src/ Tests/ ViewTestBase.php - Returns the views data definition.
File
- core/
modules/ views/ src/ Tests/ ViewTestData.php, line 125 - Contains \Drupal\views\Tests\ViewTestData.
Class
- ViewTestData
- Provides tests view data and the base test schema with sample data records.
Namespace
Drupal\views\TestsCode
public static function viewsData() {
// Declaration of the base table.
$data['views_test_data']['table'] = array(
'group' => 'Views test',
'base' => array(
'field' => 'id',
'title' => 'Views test data',
'help' => 'Users who have created accounts on your site.',
),
);
// Declaration of fields.
$data['views_test_data']['id'] = array(
'title' => 'ID',
'help' => 'The test data ID',
'field' => array(
'id' => 'numeric',
),
'argument' => array(
'id' => 'numeric',
),
'filter' => array(
'id' => 'numeric',
),
'sort' => array(
'id' => 'standard',
),
);
$data['views_test_data']['name'] = array(
'title' => 'Name',
'help' => 'The name of the person',
'field' => array(
'id' => 'standard',
),
'argument' => array(
'id' => 'string',
),
'filter' => array(
'id' => 'string',
),
'sort' => array(
'id' => 'standard',
),
);
$data['views_test_data']['age'] = array(
'title' => 'Age',
'help' => 'The age of the person',
'field' => array(
'id' => 'numeric',
),
'argument' => array(
'id' => 'numeric',
),
'filter' => array(
'id' => 'numeric',
),
'sort' => array(
'id' => 'standard',
),
);
$data['views_test_data']['job'] = array(
'title' => 'Job',
'help' => 'The job of the person',
'field' => array(
'id' => 'standard',
),
'argument' => array(
'id' => 'string',
),
'filter' => array(
'id' => 'string',
),
'sort' => array(
'id' => 'standard',
),
);
$data['views_test_data']['created'] = array(
'title' => 'Created',
'help' => 'The creation date of this record',
'field' => array(
'id' => 'date',
),
'argument' => array(
'id' => 'date',
),
'filter' => array(
'id' => 'date',
),
'sort' => array(
'id' => 'date',
),
);
$data['views_test_data']['status'] = array(
'title' => 'Status',
'help' => 'The status of this record',
'field' => array(
'id' => 'boolean',
),
'filter' => array(
'id' => 'boolean',
),
'sort' => array(
'id' => 'standard',
),
);
return $data;
}