$this->
assertEquals(array_keys($expected_enabled),
array_keys(Views::
getEnabledViews()), 'Expected enabled views returned.'
);
// Test Views::getDisabledViews().
$expected_disabled =
array_filter($all_views,
function D
$view) { return views_view_is_disabled($view);
});
$this->
assertEquals(array_keys($expected_disabled),
array_keys(Views::
getDisabledViews()), 'Expected disabled views returned.'
);
// Test Views::getViewsAsOptions().
// Test the $views_only parameter.
$this->
assertSame(array_keys($all_views),
array_keys(Views::
getViewsAsOptions(TRUE
)), 'Expected option keys for all views were returned.'
);
$expected_options =
[];
foreach ($all_views as $id =>
$view) { $expected_options[$id] =
$view->
label();
} $this->
assertSame($expected_options, Views::
getViewsAsOptions(TRUE
), 'Expected options array was returned.'
);
// Test the default.
$this->
assertEquals($this->
formatViewOptions($all_views), Views::
getViewsAsOptions(), 'Expected options array for all views was returned.'
);
// Test enabled views.
$this->
assertEquals($this->
formatViewOptions($expected_enabled), Views::
getViewsAsOptions(FALSE, 'enabled'
), 'Expected enabled options array was returned.'
);
// Test disabled views.