// We can store this now, as we have enabled/disabled above.
$all_views =
$storage->
loadMultiple();
// Test Views::getAllViews().
ksort($all_views);
$this->
assertEquals(array_keys($all_views),
array_keys(Views::
getAllViews()), 'Views::getAllViews works as expected.'
);
// Test Views::getEnabledViews().
$expected_enabled =
array_filter($all_views,
function D
$view) { return views_view_is_enabled($view);
});
$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 =
[];