ViewTestData::
createTestViews(static::
class,
['views_test_config'
]);
// Bypass any field access.
$this->adminUser = User::
create(['name' =>
$this->
randomString()]);
$this->adminUser->
save();
$this->container->
get('current_user'
)->
setAccount($this->adminUser
);
$this->testUsers =
[];
for ($i = 0;
$i < 5;
$i++
) { $this->testUsers
[$i] = User::
create([ 'name' => 'test ' .
$i,
'timezone' => User::
getAllowedTimezones()[$i],
'created' => REQUEST_TIME -
rand(0, 3600
),
]);
$this->testUsers
[$i]->
save();
} // Setup a field storage and field, but also change the views data for the
// entity_test entity type.
$field_storage = FieldStorageConfig::
create([ 'field_name' => 'field_test',
'type' => 'integer',
'entity_type' => 'entity_test',
]);