1 views_plugin_style_jump_menu.test ViewsPluginStyleJumpMenuTest::testDuplicatePaths()

Tests jump menus with more than one same path but maybe different titles.


core/modules/views/tests/styles/views_plugin_style_jump_menu.test, line 39
Definition of viewsPluginStyleJumpMenuTest.


Tests jump menu style functionality.


function testDuplicatePaths() {
  $view = $this->getJumpMenuView();

  // Setup a [path] which would lead to "duplicate" paths, but still the shouldn't be used for grouping.
  $view->field['nothing']->options['alter']['text'] = '[path]';
  $form = $view->style_plugin->render($view->result);

  // As there is no grouping setup it should be 4 elements.
  $this->assertEqual(count($form['jump']['#options']), 4 + 1);

  // Check that all titles are part of the form as well.
  $options = array_values($form['jump']['#options']);
  foreach ($options as $key => $title) {
    // The first one is the choose label.
    if ($key == 0) {
    $this->assertTrue($this->nodeTitles[$key - 1] == trim($title), t('Title @title should appear on the jump list, as we do not filter', array('@title' => $title)));