You are here

public function FieldUiTest::testGetNextDestinationRouteName in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/field_ui/tests/src/Unit/FieldUiTest.php \Drupal\Tests\field_ui\Unit\FieldUiTest::testGetNextDestinationRouteName()

@covers ::getNextDestination

File

core/modules/field_ui/tests/src/Unit/FieldUiTest.php, line 66
Contains \Drupal\Tests\field_ui\Unit\FieldUiTest.

Class

FieldUiTest
@coversDefaultClass \Drupal\field_ui\FieldUI

Namespace

Drupal\Tests\field_ui\Unit

Code

public function testGetNextDestinationRouteName() {
  $destinations = [
    [
      'route_name' => 'system.admin',
    ],
    [
      'route_name' => 'system.admin_content',
    ],
  ];
  $expected_route_name = 'system.admin';
  $expected_query = [
    'destinations' => [
      [
        'route_name' => 'system.admin_content',
      ],
    ],
  ];
  $actual = FieldUI::getNextDestination($destinations);
  $this
    ->assertSame($expected_route_name, $actual
    ->getRouteName());
  $this
    ->assertSame($expected_query, $actual
    ->getOption('query'));
}