'test_user_role' => 'test_user_role',
],
'operator' => 'not empty',
'plugin_id' => 'user_roles',
];
$view->
save();
$this->
assertEquals($expected,
$view->
getDependencies());
$view = Views::
getView('test_user_name'
);
$view->
initDisplay();
$view->
initHandlers();
$this->
assertEquals(['test_user_role'
],
array_keys($view->filter
['roles_target_id'
]->
getValueOptions()));
$view = View::
load('test_user_name'
);
$display = &
$view->
getDisplay('default'
);
$display['display_options'
]['filters'
]['roles_target_id'
] =
[ 'id' => 'roles_target_id',
'table' => 'user__roles',
'field' => 'roles_target_id',
'value' =>
[],
'plugin_id' => 'user_roles',
];
$view->
save();