2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
$this->assertIdentical(array_keys($all_views),array_keys(views_get_views_as_options(TRUE)),'Expected option keys for all views were returned.');
$expected_options=array();
foreach($all_viewsas$id=>$view){
$expected_options[$id]=$view->getHumanName();
}
$this->assertIdentical($expected_options,views_get_views_as_options(TRUE),'Expected options array was returned.');
// Test the default.
$this->assertIdentical($this->formatViewOptions($all_views),views_get_views_as_options(),'Expected options array for all views was returned.');
// Test enabled views.
$this->assertIdentical($this->formatViewOptions($expected_enabled),views_get_views_as_options(FALSE,'enabled'),'Expected enabled options array was returned.');
// Test disabled views.
$this->assertIdentical($this->formatViewOptions($expected_disabled),views_get_views_as_options(FALSE,'disabled'),'Expected disabled options array was returned.');
// Test the sort parameter.
$all_views_sorted=$all_views;
ksort($all_views_sorted);
$this->assertIdentical(array_keys($all_views_sorted),array_keys(views_get_views_as_options(TRUE,'all',NULL,FALSE,TRUE)),'All view id keys returned in expected sort order');
// Test $exclude_view parameter.
$this->assertFalse(array_key_exists('archive',views_get_views_as_options(TRUE,'all','archive')),'View excluded from options based on name');
$this->assertFalse(array_key_exists('archive:default',views_get_views_as_options(FALSE,'all','archive:default')),'View display excluded from options based on name');
$this->assertFalse(array_key_exists('archive',views_get_views_as_options(TRUE,'all',$archive->getExecutable())),'View excluded from options based on object');