$this->
assertEquals('Title',
$title_options[0
]->
getText());
// Also select the target bundle so that field_text is also available.
$page->
findField('settings[handler_settings][target_bundles][' .
$this->targetType . ']'
)->
setValue($this->targetType
);
$assert_session->
assertWaitOnAjaxRequest();
$assert_session->
optionExists('settings[handler_settings][sort][field]', 'nid'
);
$assert_session->
optionExists('settings[handler_settings][sort][field]', 'title'
);
$assert_session->
optionExists('settings[handler_settings][sort][field]', 'body.value'
);
$assert_session->
optionExists('settings[handler_settings][sort][field]', 'field_text.value'
);
// Select only the target bundle. The options should be the same.
$page->
findField('settings[handler_settings][target_bundles][' .
$this->type . ']'
)->
uncheck();
$assert_session->
assertWaitOnAjaxRequest();
$assert_session->
optionExists('settings[handler_settings][sort][field]', 'nid'
);
$assert_session->
optionExists('settings[handler_settings][sort][field]', 'title'
);
$assert_session->
optionExists('settings[handler_settings][sort][field]', 'body.value'
);
$assert_session->
optionExists('settings[handler_settings][sort][field]', 'field_text.value'
);
// Exception: the title option has a different label.
$title_options =
$sort_by->
findAll('xpath', 'option[@value="title"]'
);
$this->
assertEquals(1,
count($title_options));
$this->
assertEquals($this->targetType . ' title',
$title_options[0
]->
getText());
// Test the sort settings.